Hello,
I’m sorry to hear that you’re experiencing sporadic 404 errors on your sitemap and sitemap pages, Andrew. It’s crucial to ensure that search engines can access your sitemap correctly to index your website properly.
Since you’ve already tried excluding them from your host’s cache, the next step would be to check if there are any caching plugins causing the issue. Caching plugins can sometimes cache the sitemap files, leading to 404 errors.
If you’re using a caching plugin like W3 Total Cache, LiteSpeed Cache, or WP Super Cache, you need to exclude the sitemap files from being cached. Here are some specific instructions for each plugin:
-
W3 Total Cache: Follow the steps in this guide to exclude sitemaps from caching in W3 Total Cache.

-
LiteSpeed Cache: Exclude your sitemap from being cached by following the steps outlined in this tutorial.

-
WP Super Cache: Head over to Settings → WP Super Cache → Advanced in your WordPress dashboard and exclude the sitemap from being cached by following the steps provided in this guide.

By excluding the sitemap files from caching in these plugins, you should be able to resolve the 404 errors. If the issue persists or you need further assistance, please let us know.
Thank you for bringing this concern to our attention.
Best regards,
Sources:
How to Fix “Incorrect HTTP Header Content-Type” Error in Sitemaps » Rank Math
Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
How To Exclude Rank Math Sitemaps from Caching » Rank Math
Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
Using Video Sitemaps in Rank Math
Hello,
Thank you for your query and we are so sorry about the trouble this must have caused.
Please follow the steps below:
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. Apply the following filter code to your site.
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Here’s how you can add filter to your WordPress site:https://rankmath.com/kb/wordpress-hooks-actions-filters/
If the issue persists, please share your website URL here so we can check the sitemaps closely.
Looking forward to helping 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.