Quantcast
Channel: WordPress.org Forums » [Yoast SEO] Support
Viewing all articles
Browse latest Browse all 41911

wpseo_robots does not working correctly

$
0
0

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


Viewing all articles
Browse latest Browse all 41911

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>