In this knowledgebase article, we’re going to walk you through why the sitemap_index.xml throws a 404 error and how to solve this issue.
Why the Sitemap_index.xml Throws a 404 Error?
A 404 error basically means that the sitemap index or individual sitemap does not exist. Google bot expects a result of 200 ok responses, fetches all your website URLs via submitted sitemap file, and throws a 404 error when it cannot locate the sitemap_index.xml.
Configuring sitemaps in Rank Math is extremely simple. However, if you’re not able to use the sitemap functionality in Rank Math, please go through our knowledgebase article on Rank Math sitemap issues and their fixes that’ll help you to fix some of the common sitemap problems.
If Rank Math doesn’t create a sitemap file or get a 404 error while trying to access your sitemap index, you may have to flush permalinks or exclude the sitemap files from being cached. Please don’t be scared; it is fairly easy to do so. Let’s have a close look at how to fix this issue in Rank Math.
How to Fix
sitemap_index.xml Throws a 404 Error in Rank Math?
1 Flush the Sitemap Cache
To begin with, navigate to Rank Math > Sitemap Settings and change the Links Per Sitemap as shown below:
Click on Save Changes located at the bottom of the page. Once you’ve saved the settings, head over to your WordPress admin area and navigate to Settings > Permalinks as shown below:
Simply hit the Save Changes button once even if you didn’t make any changes on the page.
This will flush the permalinks setting and fix your sitemap problem.
2 Exclude the Sitemap Files in the Caching Plugin
Using caching plugins is probably the easiest way to speed up your WordPress site. However, you might end up getting your sitemap cached too, and this is definitely not a good idea! A sitemap should always reflect the latest posts and URLs of your website; caching it defeats the purpose.
Since you don’t have to cache the sitemaps, exclude the sitemap files generated by Rank Math plugin from being cached in your caching plugin. The cache could be via a plugin or from the server.
If you still have any questions about how to fix sitemap_index.xml throwing a 404 error – you’re always more than welcome to contact our dedicated support team. They are available 24/7, 365 days a year…
Was this article helpful?
Still need help?
Submit Your Question
Please give us the details, our support team will get back to you.