Uses
Uses | Description |
---|---|
wp-includes/option.php: get_option() | Retrieves an option value based on an option name. |
Display a noindex meta tag.
Outputs a noindex meta tag that tells web robots not to index the page content. Typical usage is as a ‘wp_head’ callback. add_action( ‘wp_head’, ‘wp_no_robots’ );
File: wp-includes/general-template.php
function wp_no_robots() { if ( get_option( 'blog_public' ) ) { echo "<meta name='robots' content='noindex,follow' />\n"; return; } echo "<meta name='robots' content='noindex,nofollow' />\n"; }
Version | Description |
---|---|
5.3.0 | Echo "noindex,nofollow" if search engine visibility is discouraged. |
3.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_no_robots