When using WordPress for your content marketing, you want to make sure that your content is optimized for search engine ranking. A great tool to do this is the WordPress SEO Plugin by YOAST.
We had an issue with this plugin where we got a 404 error when accessing sitemap_index.xml generated by the WordPress SEO Plugin by Yoast. We also use the WP Super Cache plugin on our blog.
Here is how we fixed the issue:
Exclude sitemap files from caching
- In your WP admin go to Settings/WP Super Cache.
- Go to the “Advanced” tab.
- Add this string that forces a page not to be cached:
sitemap(_index|[0-9]+)?.xml
- Clear your cache for the changes to take effect.
Re-save the WP permalink settings
- In your WP admin go to Settings/Permalinks.
- Without making any changes, submit the form.
I assume that saving permalink settings somehow triggers a missing initialization step for the sitemap plugin.
