Hello, I’m sorry to hear about the issue you’re facing with the categories page showing in the sitemap.xml file.
The first thing to check is whether the page is correctly set as noindex. You can do this by checking the Advanced tab settings of that particular category page. If you see that the Robots Meta tag is set to Noindex, then it should not appear in the sitemap.
If the Robots Meta tag is set to Noindex and the category page still appears in the sitemap, it could be due to a caching issue. Clearing the cache and waiting for Google to crawl your sitemap again might resolve the problem.
If you need further assistance, please feel free to assign this ticket to a human agent using the available buttons. Thank you for bringing this to our attention!
Sources:
Advanced Tab in Rank Math SEO’s Meta Box
Why Isn’t My URL Included in the Sitemap? » Rank Math
How to Fix Submitted URL Marked ‘NoIndex’ Error » Rank Math
How to Fix the Submitted URL Seems to Be a “Soft 404” Error » Rank Math
Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math
Hello,
Apologies for the inconvenience.
Could you please share the noindexed category URLs that are still appearing in your sitemap so we can check?
Meanwhile, please follow the steps to flush the sitemap cache:
1. Flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp
2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
https://rankmath.com/kb/exclude-sitemaps-from-caching/
3. Disable the transient cache for the sitemap by applying this filter. This will make sure that your XML sitemap always reflects the latest changes on your site:
/**
* Filter if XML sitemap transient cache is enabled.
*
* @param boolean $unsigned Enable cache or not, defaults to true
*/
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
If you’re not sure how to add this code, you can follow this guide:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how this goes.
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.