Bulk updating Noindex/Nofollow status of pages/posts

#43938
  • Resolved Russell Semenov
    Rank Math pro
    Content AI Expert

    Hello,
    Is there any way I can bulk edit the Follow/Nofollow Index/Noindex settings for pages and posts?

    If I have 30+ pages/posts it is very time consuming having to set those parameters manually on page by page basis

    Also – It would be very useful to see these parameters in a column on page/posts listings in the admin area (Similar to “SEO Details”, “SEO Title” and “SEO Desc”)

    Thank you
    Russell

Viewing 6 replies - 1 through 6 (of 6 total)
  • Russell Semenov
    Rank Math pro
    Content AI Expert

    PS I know there is a default follow/nofollow etc ON/OFF switch for pages and posts in the RankMath settings, but I was referring to editing those on individual basis

    In other words, I realized I have a bunch of pages that I need to switch to Noindex, it would be more convenient if I could set that in ‘bulk’ – THANKS!

    Hello,

    Thank you for contacting Rank Math today.

    I am afraid that we do not yet have bulk update options for these settings.
    Even though you can toggle the index and nofollow from the Rank Math > Titles & Meta page, these settings will only take effect when creating new posts.

    To workaround this, you can make use of a filter to set all the posts on the post type to index/follow like so:

    /**
     * Allows filtering of the robots meta data.
     *
     * @param array $robots The meta robots directives.
     */
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
         global $post;
         // filter for only a specific post type
         if(get_post_type() == "your_post_type_name_here"){
            $robots['index'] = "index";
            $robots['follow'] = "follow";
            return $robots;
         }
    	return $robots;
    });

    Looking forward to helping you. Thank you.

    ​​​​​​

    Yannis
    Rank Math free

    I am also interested in this as I have maybe around 500 pages that have been created via a plugin that I want to add the noindex and nofollow option. How would the above work to do this in bulk for these custom page/post types?

    Thanks,
    Yannis

    Todd
    Rank Math free

    Hi Yannis,

    You just need to add the above code to your theme’s functions.php file.

    Just make sure to change your_post_type_name_here with the actual post type name. If you are not sure, you can ask your theme provider.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Yannis
    Rank Math free

    Awesome. It was actually just over 9,000 pages that needed nofollowing and noindexing and it seems to have worked 🙂

    Todd
    Rank Math free

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

The ticket ‘Bulk updating Noindex/Nofollow status of pages/posts’ is closed to new replies.