noindex()WP 2.1.0

Устарела с версии 5.7.0. Больше не поддерживается и может быть удалена. Используйте wp_robots_noindex() on 'wp_robots' filter.

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.

Typical usage is as a wp_head callback:

add_action( 'wp_head', 'noindex' );

Хуков нет.

Возвращает

null. Ничего (null).

Использование

noindex();

Заметки

Список изменений

С версии 2.1.0 Введена.
Устарела с 5.7.0 Use wp_robots_noindex() instead on 'wp_robots' filter.

Код noindex() WP 6.5.2

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();
	}
}