A HitchHackers guide through WordPress


Home | Pages | Archives


noindex

February 12, 2011 1:55 am

Definition:
function noindex() {}

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. Add this to the wp_head action. Typical usage is as a wp_head callback. add_action( ‘wp_head’, ‘noindex’ );

Source code

function noindex() {

	// If the blog is not public, tell robots to go away.

	if ( '0' == get_option('blog_public') )

		wp_no_robots();

}

2457

Rate this:

Posted by Thorsten

Categories: /wp-includes/general-template.php, Documentation, Files, Functions, Functions by letter n

Tags: ,

Leave a Reply



Mobile Site | Full Site


Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.