Replies: 0
Hello everyone, I’m just faced issue when trying to remove noindex from search page on my wordpress site.
I’m using this code snippet from other topics:
add_filter('wpseo_robots', 'yoast_no_home_noindex', 999);
function yoast_no_home_noindex($string) {
$string = "";
if (is_home() || is_front_page() || is_search()) {
$string= "index,follow";
}
return $string;
}
But when I’m reload my search page, in the inspector I see this meta tag:
<meta name="robots" content="noindex, follow, index,follow">
I’m using wordpress 5.7.5 and yoast 17.6