mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Introduce wp_no_robots(). Call it for pages that should never be indexed, regardless of blog privacy settings. Props nacin. fixes #19251
git-svn-id: https://develop.svn.wordpress.org/trunk@19304 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1677,14 +1677,29 @@ function wlwmanifest_link() {
|
||||
* Display 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.
|
||||
* 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' );
|
||||
*
|
||||
* @see wp_no_robots
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
function noindex() {
|
||||
// If the blog is not public, tell robots to go away.
|
||||
if ( '0' == get_option('blog_public') )
|
||||
echo "<meta name='robots' content='noindex,nofollow' />\n";
|
||||
wp_no_robots();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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' );
|
||||
*
|
||||
* @since 3.3.0
|
||||
*/
|
||||
function wp_no_robots() {
|
||||
echo "<meta name='robots' content='noindex,nofollow' />\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user