Php WP查询/Noindex
我在我的WP网站上停用了以下内容:Php WP查询/Noindex,php,wordpress,Php,Wordpress,我在我的WP网站上停用了以下内容: add_action('template_redirect', 'remove_wp_archives'); function remove_wp_archives(){ if( is_tag() || is_attachment() || is_author() || is_date() || is_search()) { global $wp_query;
add_action('template_redirect', 'remove_wp_archives');
function remove_wp_archives(){
if( is_tag() || is_attachment() || is_author() || is_date() || is_search()) {
global $wp_query;
$wp_query->set_404();
}
}
这是否意味着,如果我不希望这些页面/档案被索引,我仍然需要将noindex添加到这些页面/档案中?或者搜索引擎会被重定向到404吗?既然我已经将noindex设置为404,它会自动被noindex设置为404吗