我想让搜索引擎机器人为我的分类页面编制索引,但似乎没有索引,follow标签是由我的主题函数自动添加的
我希望分类页允许索引,同时保留noindex,follow for search和404页
下面是它们的一部分(functions.php)
/*Add noindex to low value pages*/
function add_noindex_tags(){
# Get page number for paginated archives.
$paged = intval( get_query_var( \'paged\' ) );
# Add noindex tag to all archive, search and 404 pages.
if( is_archive() || is_search() || is_404() )
echo \'<meta name="robots" content="noindex,follow">\';
# Add noindex tag to homepage paginated pages.
if(( is_home() || is_front_page() ) && $paged >= 2 )
echo \'<meta name="robots" content="noindex,follow">\';
}
add_action(\'wp_head\',\'add_noindex_tags\', 4 );
?>
有人能帮我编辑代码吗?