noindex() - WordPress 函数参考中文文档

返回介绍

noindex()

发布于 2017-09-11 字数1216 浏览 891 评论 0

noindex()

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. Add this to the ‘wp_head’ action.

Typical usage is as a ‘wp_head’ callback:

add_action( 'wp_head', 'noindex' );

源代码

File: wp-includes/general-template.php

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

更新日志

Version 描述
2.1.0 Introduced.

相关函数

Uses

  • wp-includes/general-template.php:
    wp_no_robots()
  • wp-includes/option.php:
    get_option()

User Contributed Notes

上一篇:nocache_headers()

下一篇:normalize_whitespace()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!