• Resolved Priyanka Behera

    (@priyankabehera155)


    Hello everyone, I’m just faced issue when trying to remove noindex from search page on my wordpress site.

    I’m using wordpress 6.0.3 and yoast 19.13

    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;
    }

    I am using this code to remove the noindex, follow. But instead it is adding the content.

    <meta name="robots" content="noindex, follow, index,follow">

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wpseo_robots does not working correctly’ is closed to new replies.