• Resolved shmd

    (@shmd)


    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 1 replies (of 1 total)
  • @shmd

    As it seems you’re using an older version of WordPress and Yoast SEO, could you please update both to their latest version v5.8.3 and v17.9, and see if that resolves this issue?

Viewing 1 replies (of 1 total)

The topic ‘wpseo_robots does not working correctly’ is closed to new replies.