Common XML sitemap errors

Are you getting an error on or about your XML sitemap? In this article, we’ve listed the most common XML sitemap errors, along with their causes and solutions.

Yoast SEO Premium makes it easy to improve and control your site structure. Among the many other benefits, it also comes with an internal linking feature and content filters. Their job is to make sure your audience and search engines find the posts and pages they need on your site.

If the ‘Detected’ date is not today’s date, please test the individual sitemap to verify whether or not the issue has been resolved.

Types

Sitemap errors (General)

ErrorCauseSolution
My sitemap is not using the URL format. For example, it does not include/exclude www or has HTTP instead of HTTPS.The sitemap uses the same protocol as the WordPress Site URL.Go to Admin > Settings > General and change the site URLs to the correct protocol. If you have recently switched your URL format, you may have incorrectly formatted URLs in your database. Please backup your database and complete a search and replace the old with the new format.
My sitemap is a white page or a header with no URLs.Your XSLT file is unavailable, the XML is invalid, or the “Do not process 404 errors for static objects with WordPress” setting is checked in W3 Total Cache.Check this page to see which error applies to you, and fix it accordingly.
My sitemap doesn’t work on an Apache server.Most likely, you haven’t implemented our rewrite rules.This article has more advice on troubleshooting the sitemaps on Apache servers: Yoast XML Sitemaps on Apache servers
My sitemap doesn’t work on an NGINX server.Most likely, you haven’t implemented our rewrite rules.This article has more advice on troubleshooting the sitemaps on NGINX servers: Yoast XML Sitemaps on NGINX servers
My plugin won’t create a sitemap.The settings of your permalinks aren’t properly saved.Go to WordPress ‘Settings’ in the backend Go to ‘Permalinks’ Click ‘Save Changes’ (without altering anything)
The sitemap has gray links.This is how we built it.Gray links in your sitemap identify recently visited URLs in your own browser. Google does not see the browser formatting as they retrieve the XML source code. Learn more in this article about gray links in sitemaps.
My new videos are at the bottom of my second sitemap.This is how we built it.This way only the last video sitemap changes and Google only needs to re-fetch that one instead of re-fetching all the video sitemaps all the time. The last update time will tell Google what’s new.
My sitemap does not update.Sometimes the cache functionality on your site prevents the sitemap from updating automatically. This article has more advice on how to tackle this issue: Sitemap does not update.
I don’t see an individual page in my sitemap. There are multiple reasons an individual page may be missing from the XML sitemap:
1. You have set the page (or the whole post type) to noindex.
2. The page’s canonical URL is set to a different URL.
3. The page was redirected to another URL by Yoast SEO Premium.
4. If it’s the news sitemap, the page has not been published within the past 48 hours.
1. To check if an individual page is set to noindex, go to the Advanced tab in the Yoast SEO metabox or sidebar, and make sure you allow search engines to show the page in the search results. To check the settings for the whole content type/taxonomy, go to the Advanced settings in Yoast SEO and ensure you are not blocking search engines from accessing your content. 
2. To check if the page’s canonical URL is set to a different URL, use the URL inspection tool and follow Google’s guidelines on consolidating duplicate URLs.
3. If you are using Yoast SEO premium, check if the page was redirected to another URL in Yoast’s redirect manager.

Errors in Google Search Console

ErrorCauseSolution
XML or text declaration not at start of entity / XML declaration allowed only at the start of the documentThere are probably several lines of whitespace preceding the <?xmltagTo be sure this is the case, follow the steps on this page. After that, start searching. Something in your WordPress install, either a plugin or your theme is outputting whitespace, and it shouldn’t… It’s not a bug in our plugin. A conflict check may
be helpful.
Unsupported format. Your file appears to be an HTML pageYou’re using W3 Total Cache and you’ve ticked the setting to hide the sitemap from normal visitors.You should create an extra user agent group. You can do that by following the steps on this page.
URL blocked / restricted by robots.txtThis error appears when Google is unable to crawl the specific URL due to a robots.txt restriction.Check this page to see which restriction is applied to your site and fix it accordingly.
Your Sitemap or Sitemap index file doesn’t properly declare the namespace.This error appears when something on your site is modifying URLs after the sitemap is generated.This is virtually impossible for us to locate or fix as it’s not something controlled by our plugin. See this article for more information.
Missing XML tag. This required tag is missing. Please add it and resubmit.This error appears when the sitemap contains zero items.Please create content for the sitemap. See this article for more information.
General HTTP error: 404 not foundThere’s a handful of causes depending on which sitemap displays the error.If it’s your sitemap index, you should follow these steps. If it’s an individual sitemap, you should follow these steps. If you have a custom post type ‘Video’, add a single line of code to your functions.php. If you have a custom post type ‘News’, add a single line of code to your functions.php.
Unknown news siteYour website may not be approved for Google News.Please verify the URL submitted to Google News exactly matches the URL in your sitemap. If you have not applied for inclusion, please visit the Google News Publisher Center.

Errors in Bing Webmaster Tools

ErrorCauseSolution
Download of the sitemap or feed failed.The sitemap may not be accessible to Bing.Use Bing’s Mobile Friendliness Test Tool to see if Bing can read the sitemap. If the tool successfully loads feedback, resubmit the sitemap to Bing. If the tool is unsuccessful, your site may be slow or have restrictions set for Bing. Check out the site speed tools we recommend to locate areas where you can improve your speed. Your web host may also be helpful when a site is slow.

Related articles

Get free SEO tips!