Uses
Uses | Description |
---|---|
wp-includes/general-template.php: wp_no_robots() | Display a noindex meta tag. |
wp-includes/option.php: get_option() | Retrieves an option value based on an option name. |
Displays a noindex meta tag if required by the blog configuration.
If a blog is marked as not being public then the noindex meta tag will be output to tell web robots not to index the page content. Add this to the ‘wp_head’ action.
Typical usage is as a ‘wp_head’ callback:
add_action( 'wp_head', 'noindex' );
File: wp-includes/general-template.php
function noindex() { // If the blog is not public, tell robots to go away. if ( '0' == get_option( 'blog_public' ) ) { wp_no_robots(); } }
Version | Description |
---|---|
2.1.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/noindex