noindex

函数
noindex ( No parameters )
相关
  • wp_no_robots()
定义位置
相关方法
drop_indexwp_robots_noindexadd_clean_indexlogin_headerdomain_exists
引入
2.1.0
弃用
5.7.0

noindex: 这个函数生成一个noindex元标签,用于WordPress页面的HTML头部部分。它用于指示搜索引擎不要索引该页面。

如果博客配置需要,显示一个`noindex`元标签。

如果一个博客被标记为不公开,那么”noindex”元标签将被输出,告诉网络机器人不要索引该页面内容。

典型的用法是作为{@see ‘wp_head’}的回调。

add_action( ‘wp_head’, ‘noindex’);

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

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2026-01-29 11:09:38

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: