Hello,
Thank you for contacting Rank Math today.
You can add a noindex tag to the page by editing the individual pages and checking the noindex checkbox in Rank math meta box under Advanced tab.
This will automatically remove the pages from the sitemap.
We however do not have an option to bulk noindex the pages within a category if that’s your intention. As a work around you can customize the following filter and add it to your theme functions.php file to add the noindex tag to the specified pages:
/**
* 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 category
if(get_category() == "your_category_name_here"){
$robots['index'] = "noindex";
$robots['follow'] = "follow";
return $robots;
}
return $robots;
});
Looking forward to helping you. Thank you.
Sorry, I might havent been clear. I want to bulk exclude posts within a category not pages.
There is an RSS Feed catcher fetching headlines but I doubt it is good for SEO that these are indexed by Google
Hello,
I am sorry if I don’t understand it right but as far as I understand you want to exclude from index all the posts in specific categories and you should be able to achieve exactly that using the code my colleague shared. Is it what you want to achieve?
Looking forward to help you.
Hello,
Then, you should be able to achieve it with the code my colleague shared, what kind of issues did you face using it?
Looking forward to help you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.