Hello,
We apologize for the issue you are facing with the 404 error on your Rank Math sitemap. It sounds frustrating to have to flush permalinks every day. Here are some steps you can take to help resolve this issue:
-
Flush Permalinks: You can flush permalinks by navigating to your WordPress admin area and going to Settings → Permalinks. Simply click the Save Changes button, even if you don’t make any changes. This should help fix the 404 error temporarily.

-
Exclude Sitemap from Caching: Ensure that your caching plugin is properly configured to exclude the sitemap from being cached. You can refer to this dedicated knowledgebase article for guidance on how to do this.
-
Disable Transient Caching: If the problem persists, you might want to disable transient caching for your sitemap. You can add the following filter to your theme’s rank-math.php
file:
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
-
Check for Plugin Conflicts: Sometimes, other plugins can interfere with the sitemap functionality. You can use the Health Check plugin to check for any conflicts.
-
Check Robots.txt: Ensure that your robots.txt file is not blocking access to your sitemap. You can check this in Rank Math SEO → General Settings → robots.txt.
If you continue to experience issues, please reply to this ticket with your site URL so that a human agent from our support team can assist you further. Thank you for raising this concern!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Rank Math XML Sitemaps on NGINX Servers » Rank Math
Hello,
It mostly happens when your sitemap is heavily cached. In this case, you can apply the following filter to your site to disable the transients cache for the sitemap and see if that works for you.
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Here’s how you can add filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how it goes. Looking forward to helping you.
Thank you.
i already did it but it after a few days it goes on 404 again
Hello,
If the issue persists, then your sitemaps must still be getting cached.
You should 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/
You can also get in touch with your web host to exclude your sitemaps from their internal cache.
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.