wp_no_robots

函数


wp_no_robots ( No parameters )
定义位置
  • wp-includes/deprecated.php
    , line 4164
引入
3.3.0
弃用
5.7.0

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 {@see ‘wp_head’} callback:

add_action( ‘wp_head’, ‘wp_no_robots’ );

function wp_no_robots() {
	_deprecated_function( __FUNCTION__, '5.7.0', 'wp_robots_no_robots()' );

	if ( get_option( 'blog_public' ) ) {
		echo "n";
		return;
	}

	echo "n";
}