Fix SEO Plugin to show meta robots index,follow in WordPress

Using the recent WordPress version (3.8) with a SEO plugin (SEO Ultimate, WP SEO, Yoast), the robots information for index,follow did not appear anymore. If you are using these plugins and don’t see any index and follow anymore, this might help you.

Here is my fix for WP SEO by Yoast:

Edit the file  wp-content/plugins/wordpress-seo/frontend/class-frontend.php

look for the line public function robots() { (about line 550)

And extend its end by the else statement:

2 thoughts on “Fix SEO Plugin to show meta robots index,follow in WordPress

  1. Hey Daniel,
    you don’t have to modify the core-file. You can use a filter. Just add it to the functions.php in your theme:

    function add_index_follow_to_meta_robots( $data ) {
    $data = ($data == ” || $data == ‘noodp,noydir’) ? ‘index,follow,’.$data : $data;
    return $data;
    }
    add_filter( ‘wpseo_robots’, ‘add_index_follow_to_meta_robots’ );

    This is not a very clean code, but might be an approach.

Leave a Reply

Your email address will not be published. Required fields are marked *