移除搜索页面,Yoast SEO插件,Meta标签Noindex
Theme Functions (functions.php)
add_filter( 'wpseo_robots', 'yoast_seo_robots_remove_search' );
function yoast_seo_robots_remove_search( $robots ) {
if ( is_search() ) {
return false;
} else {
return $robots;
}
}
Theme Functions (functions.php)
add_filter( 'wpseo_robots', 'yoast_seo_robots_remove_search' );
function yoast_seo_robots_remove_search( $robots ) {
if ( is_search() ) {
return false;
} else {
return $robots;
}
}