The Couldn’t Fetch sitemap error is, in most cases, simply due to a bug in the Google Search Console. Here’s what to do if you encounter this on one of your websites:
1 Configure your sitemap
First, you need to ensure that you have configured the sitemaps correctly. To do so, please refer to this Rank Math Sitemap configuration tutorial. Upon completion, you can validate your sitemap here: Validate XML Sitemap.
2 Fix Sitemap Issues
If the sitemap is blank, then you have to make sure that posts/pages/CPTs/Terms exist and are indexable. Content that has been set to no-index is not included in the sitemaps.
Some other sitemap related issues and their fixes if the sitemaps are not loading correctly in the browser and getting errors on the testing tool.
You can check if your content is indexable from the Rank Math > Titles & Meta.
To check if an individual page/post is indexed or not go to the particular post/page then in Advanced settings in Rank Math SEO you will find the index check-box. In order to index your post/page check the checkbox.
3 Flush the cache
If it looks like your sitemap is outdated, you need to flush the sitemap cache. To do so, simply navigate to Rank Math > Sitemap Settings.
In this field, enter increment the links per sitemap and then save your settings by clicking Save.
And then navigate to your site’s settings for permalinks – located under Settings > Permalinks and then simply save press save to ensure the current settings have been properly applied.
4 Exclude The Sitemap From Caching
Refer to the following knowledgebase article to ensure that your sitemaps are excluded from caching.
5 Check For The Correct Version Of The Sitemap
You need to ensure that only one version of the sitemap is available. There is a possibility that there are different versions of your website that are viewable in the browser.
5.1 Check URL Set in WordPress General Settings
a) The correct version of your sitemap is submitted to Google. You can check your site settings at WordPress Dashboard > Settings > General.
Sometimes, there are chances that you have the https://domain.com version on your website but submit the http://domain version to Google. Sometimes, www. is prefixed on the website but not to the sitemap URL submitted to Google.
5.2 Ensure Sitemap Is Accessible
Enter all 4 variations of the sitemap in httpstatus.io and check the results.
Only one of the 4 variations should show a 200 status code. The 3 remaining ones should show 301.
5.3 Decide Which Version (www vs. non-www) You Want To Use
To check which version you should choose (if you don’t know already and have an existing site), running the following search (for your own site, of course) can be useful:
Then, check which variation of the domain opens:
This is the version you should likely choose but it depends on your preference as well and more than anything else, you need to be consistent.
5.4 Redirect All Three Other Versions To Your Preferred Variation
You need to ensure that the other 3 variations are all redirected to the 4th and final chosen/preferred one. This can be done using both the .htaccess and Nginx methods.
You can read this tutorial of the .htacess method that will help you to redirect non-www to www URLs using the .htaccess file in your public_html folder. Also, you can go through the Nginx method that will help you redirect from the www to non-www variation of your website with Nginx
Was this article helpful?
Still need help?
Submit Your Question
Please give us the details, our support team will get back to you.