Jun
Jun

Reputation: 41

Wordpress robots index follow is not included, even though search engine visibility unchecked

I already unchecked it: Settings -> Reading -> Search engine visibility. So it is in set production now. But i can see only "max-image-preview:large" in the content.

enter image description here

I already tried to add in functions php manually:

function wp_add_robots_custom( $robots ) {
    $robots['follow'] = true;
    $robots['index'] = true;
    
    return $robots;
}
add_filter( 'wp_robots', 'wp_add_robots_custom' );

Therefore i can see that added in my dev localhost. But it's still not showing in production (online). Has anyone an idea?

Upvotes: 0

Views: 569

Answers (2)

AutoTeam100x
AutoTeam100x

Reputation: 1

this works.

function custom_wp_robots($robots) {
                // Clear all existing directives
                $robots = array();
                
                // Add your custom directives
                $robots['index'] = true;
                $robots['follow'] = true;
               

                return $robots;
            }
            add_filter('wp_robots', 'custom_wp_robots');

Upvotes: 0

Tony McCreath
Tony McCreath

Reputation: 3399

follow and index are the default behaviours, so they are not required.

If noindex and none are not present, then index is assumed. If nofollow and none are not present, then follow is assumed.

https://developers.google.com/search/docs/advanced/robots/robots_meta_tag

Upvotes: 1

Related Questions