If you use Rank Math and you suddenly find that your sitemaps are gone, there are 2 quick fixes you can do to get back to normal.
If you’re lucky, you’ll stumble on this problem. Otherwise, you’ll have to hope Google Search Console notifies you. We found out about one instance due to our monitoring system.
Flush Permalinks When Sitemaps Are Gone
According to this fix sitemap issues article by Rank Math, you should try to flush your permalinks setting. This will stop the 404 error you’re getting when accessing your website’s sitemap index.
This will work whether Rank Math doesn’t create a sitemap file for you or you get a 404 error while accessing your sitemap index.
Simply navigate to Settings > Permalinks in the WordPress Admin area (
/wp-admin/options-permalink.php), then click the Save Changes button.
You don’t have to make any changes. Just simply resaving your permalink structure will do the trick.
Go to your sitemap link to confirm. Your sitemap index looks like this:
Flush Sitemap Cache When Sitemaps Are Gone
The flush permalinks trick should get you sorted out on its own. If the previous trick doesn’t work, try a sitemap cache flush.
To flush the sitemap cache, navigate to Rank Math > Sitemap Settings and change the Links Per Sitemap to something other than 200. Changing this to 201 is fine for now.
Next, click on Save Changes to finalize the change.
Now, this issue should be fixed. If you need more information, check out Rank Math’s dedicated KB article Why the Sitemap_Index.xml is Throwing a 404 Error. There are more fixes to try in both of those Rank Math articles. Good luck!