Forum

How to remove noind...
 
Notifications
Clear all

How to remove noindex tag from yoast seo?

 
(@administrator)
Member Admin

Here is my code..............

For search pages, you can remove no index tags from pages and search results....

// ApurbaDa Start //
function wporg_wp_robots_add_follow( $robots ) {
    unset( $robots['noindex'] );
    //unset( $robots['max-image-preview'] );
    //unset( $robots['follow'] );
    $robots['follow'] = false;
    $robots['max-image-preview'] = false;
    return $robots;
}
add_filter( 'wp_robots', 'wporg_wp_robots_add_follow' );

/**
  * EDITED BY OBOT ERNEST
  * REMOVES NOINDEX META TAG FROM HOME PAGE  & SEARCH PAGE IMPLEMENTED BY YOAST
*/


add_filter('wpseo_robots', 'yoast_no_home_noindex', 999);

    function yoast_no_home_noindex($string= "") {
        if (is_home() || is_front_page() || is_search()) {
            $string= "index,follow";
        }
        return $string;
    }

// ApurbaDa End //
Quote
Topic starter Posted : 23/09/2022 4:29 pm
Share:
×