Hello,
Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.
Please head over to WordPress Dashboard > Rank Math > Titles & Meta > Post Type > [Archive] Archive Robots meta and enable that option to set them to index/noindex.
Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.
Thank you
Hi,
Thanks for your reply.
I can’t see this option “[Archive] Archive Robots meta” – I can only see the following option “Post Robots Meta”. Maybe this is this only available in the pro version?
Can you share a screen shot of this for Posts?
Thanks
Hello,
It seems that you’re not referring to the category/tag archive of your post.
In this case, you can use the following filter to set the archive of your post type as Noindex:
add_filter( 'rank_math/frontend/robots', function( $robots ) {
if (is_post_type_archive('post')) {
$robots['index'] = 'noindex';
}
return $robots;
});
And here’s a guide to adding the code to the website:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps.
Thank you.
Thanks for this. How do you use more than one Custom Post Type with this code?
Also is this going to be added to Rankmath at any point so that you don’t have to use code? I can see there is already an option for Authors so why not make it available for any custom post type?
Thanks
Hello,
You may try the following filter to apply noindex to multiple CPT archives
add_filter( 'rank_math/frontend/robots', function( $robots ) {
$post_type = get_post_type(get_queried_object());
$all_cpt = array('cpt_slug','cpt_slug','cpt_slug'); //replace 'cpt_slug' with your CPT slug(s)
if (is_post_type_archive($all_cpt)) {
$robots['index'] = 'noindex';
}
return $robots;
});
Also is this going to be added to Rankmath at any point so that you don’t have to use code?
I’ve already forwarded this as a feature request to our internal team and be assured that, if this is something that we can implement in future, we’ll surely let our users know once there’s any update we have on this via regular communication channels like Facebook, mail, etc.
Let us know how it goes. Looking forward to helping you.
Thank 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.