如果博客配置需要,则显示noindex元标记。
原型
noindex()
描述
如果博客被标记为不公开,则将输出noindex元标记以告知网络机器人不对页面内容编制索引。将其添加到’wp_head’操作中。
参考:
- wp_no_robots
源文件
路径:wp-includes/general-template.php
<?php
...
function noindex() {
// If the blog is not public, tell robots to go away.
if ( '0' == get_option('blog_public') )
wp_no_robots();
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/noindex/