Warning: This function has been deprecated. Use wp_no_robots() instead.

noindex()

Displays a noindex meta tag if required by the blog configuration.


Description Description

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' );

See also See also


Top ↑

Source Source

File: wp-includes/deprecated.php

function noindex() {
	_deprecated_function( __FUNCTION__, '5.7.0', 'wp_robots_noindex()' );

	// If the blog is not public, tell robots to go away.
	if ( '0' == get_option( 'blog_public' ) ) {
		wp_no_robots();
	}
}


Top ↑

Changelog Changelog

Changelog
Version Description
5.7.0 Use wp_robots_noindex() instead on 'wp_robots' filter.
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.