Hi Dave,
Thanks for getting in touch with us.
You can remove certain posts/pages/CPTs from Sitemap by adding them to the exclusion list at WordPress Dashboard > Rank Math > Sitemap Settings.
You can noindex CPTs from WordPress Dashboard > Rank Math > Titles & Meta > *your CPT* > Robots meta.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Todd,
Thanks for the quick reply. I think you’re referring to the two places that I’ve included screenshots of below.
The problem is that both refer to single posts. I want to exclude the archive page, but INCLUDE the single posts for the CPT.
The sitemap settings ask for a post ID, but the archive page doesn’t have a post ID.
The robots meta section explicitly says that the settings are for single posts.
And I missing something? Are these not the areas you’re referring to?
Hello,
Thank you for contacting Rank Math today.
In order to make this work, you would need to write some custom code to target the archive page and set this to noindex using the following filter:
/**
* Allows filtering of the robots meta data.
*
* @param array $robots The meta robots directives.
*/
add_filter( 'rank_math/frontend/robots', function( $robots ) {
return $robots;
});
Looking forward to helping you. Thank you.
​​​​​​
Hello Dave,
We are so glad to be of help. We are always here if you need us in the future.
Hey, if it isn’t too much to ask for – would you mind leaving us a review here?
https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post
It only takes a couple of minutes but helps us tremendously.
It would mean so much to us.
Thank you.