How to fix sitemap errors in Google Search Console

By Pablo Murad. Last updated

Open the sitemap in the Sitemaps report, read the exact error on its details page and match it to the tables below. Each row gives Google's own wording for the message, what causes it and how to fix it. The errors fall into two groups: Google could not fetch the file, or it fetched the file and could not read it cleanly.

What the Sitemaps report statuses mean

The report shows the result of Google's last request for each sitemap. According to Google's Sitemaps report help, it lists only sitemaps submitted through the report or the Search Console API, only for the current property, and shows at most 1,000 submitted requests. A sitemap Google found through robots.txt does not appear.

Sitemaps report statuses, what they mean and what to do
Status or messageWhat it meansWhat to do
SuccessGoogle fetched the sitemap and read it without errors. All its URLs are queued for crawling.Nothing to fix.
Has errorsGoogle fetched the sitemap but found one or more errors. URLs it could parse without errors are still queued.Open the sitemap in the report to see the list of errors.
Couldn't fetchGoogle could not retrieve the sitemap file.Work through the fetch errors below.
Sitemap had X errorsGoogle fetched the sitemap and read part of it, but hit some errors.Expand the errors and fix them.
Sitemap could not be readThe details page message when the fetch failed.Fix the problem and resubmit the sitemap.
Sitemap can be read, but has errorsThe details page message when Google read the file and listed errors.Review each error in the list.

If a fetch fails, Google retries for a few days and then stops, so fix the cause and resubmit. Problems with individual URLs inside a sitemap do not stop Google from reading the rest of it.

"Couldn't fetch": why Google cannot get the file

This status means Google could not retrieve the sitemap file itself. Google lists five possible reasons.

Reasons for the Couldn't fetch status, their fixes, and how GenMap relates
Reason (Google's wording)Cause and fixGenMap
The sitemap is blocked by your robots.txt file.Google respects robots.txt when fetching sitemaps. Remove the rule that blocks the file.Outside the crawl. Test the rule with the robots.txt tester.
Your site has a manual action.Sitemaps are not read while a manual action is unresolved. Check the Manual actions report, fix the issue and resend the sitemap.Not a sitemap problem.
The URL provided for the sitemap is wrong (HTTP 404 error: sitemap not found at the address provided).Open the URL in a browser and check that the file exists.Upload the file to the exact path you submit, then open that URL yourself.
Some other general error.Server unavailability, for example. Some of these are transient: wait and see whether later attempts hit the same error.Nothing to change in the file.
There is low crawl demand for the sitemap.Google ties crawl demand to the quality of the site's content: the higher the quality, the higher the demand.Nothing to change in the file.

How to debug a fetch error

  1. Click the sitemap in the report, then click the error name to see its details.
  2. Copy the sitemap URL from the details page and paste it into the URL Inspection tool.
  3. Click Live test and expand the Page availability section.
  4. Check that Crawl allowed? says "Yes" and Page fetch says "Successful".

The steps come from Google's help page on the URL Inspection tool and the Sitemaps report.

Parsing errors: the file loads, but Google cannot read it cleanly

These errors appear after Google fetched the file. Google says its list is not complete, but it covers most of what you will see. Search Console may show these messages translated into your language; the English wording below is how Google documents them. The last column describes what GenMap does when it writes the file.

Sitemap parsing errors in Search Console, with cause, fix and what GenMap does
MessageCause and fix (Google)GenMap
URLs not accessibleGoogle hit an error crawling a URL in the sitemap. Inspect the URL with the URL Inspection tool.Lists only pages that returned 200 when it crawled them. Crawl again after a deploy.
URLs not followedToo many redirects, or relative URLs. Replace redirecting URLs with the final ones, use absolute links, and avoid JavaScript or meta-refresh redirects.Writes the final URL after a redirect, in full.
URL not allowedThe sitemap includes URLs at a higher level or on a different domain than the file. A missing www, or a different protocol such as https for a sitemap served over http, counts as a different domain.Upload the file at the root of the site you crawled, with the same protocol and host.
Compression errorGoogle could not uncompress the file. Recompress it with a tool such as gzip, upload it and resubmit.Writes the gzip file itself. Download it again and upload it unchanged.
Empty sitemapThe file contains no URLs.If a crawl finds no indexable page, the report lists why pages were left out.
Sitemap file size error: Your sitemap exceeds the maximum file size limit.The file is larger than 50 MB uncompressed. Break it into smaller sitemaps, list them in a sitemap index file and submit the index.Splits above the limits and writes the index.
Invalid attribute valueAn XML attribute has an invalid value. Check that only allowed attributes are present, with allowed values, and look for typos.Attributes come from the generator, not from hand-typed XML.
Invalid dateA date is in the wrong format or is not a real date. Use W3C Datetime, such as 2005-02-21 or 2005-02-21T18:00:15+00:00. If you include a time, include a time zone.Writes lastmod in W3C format with a UTC offset, and leaves it out when a page reports no date.
Invalid tag valueA tag has an invalid value. Check the specification for your sitemap type.Tag values come from crawl data, and the XML writer escapes them.
Invalid URLA URL has unsupported characters, spaces, quotes, or a malformed scheme such as htp://. Encode and escape URLs properly, and try pasting the URL into a browser.Writes the URLs it crawled. The XML writer escapes &, < and >.
Invalid URL in sitemap index file: incomplete URLThe index does not give the full URL of each sitemap, so Google looks in the index's own directory. Use the complete path to each sitemap and resubmit.Check the loc lines in the index and make them match the URLs where you upload each file.
Invalid XML: too many tagsAn entry has duplicate tags, such as two loc tags. The error names the tag and line. Remove the duplicate and resubmit.Writes one loc per url entry.
Missing XML attributeA tag lacks a required attribute. Add it and resubmit.Attributes come from the generator, not from hand-typed XML.
Missing XML tagAn entry lacks a required tag. The error gives the line number.Every url entry gets a loc.
Incorrect sitemap index format: Nested sitemap indexesAn index lists itself or another index. An index can list only sitemap files. Remove those entries and resubmit.The index lists sitemap files only.
Parsing errorGoogle could not parse the XML, often because of an unescaped character in a URL. Data values must escape & ' " < > as XML entities.The XML writer escapes special characters.
Temporary errorGoogle had a temporary problem processing the sitemap. Usually you do not need to resubmit. If the error is still there after several hours, resubmit.Nothing to change in the file.
Too many sitemapsThe index lists more than 50,000 sitemaps. Split it into several index files of no more than 50,000 sitemaps each.Out of reach: the largest plan's 1,600,000-page cap fits in 32 files of 50,000 URLs.
Too many URLsThe sitemap lists more than 50,000 URLs. Split it into several sitemaps, or use a sitemap index file.Splits at the limit and writes the index.
Unsupported formatThe file is not in a supported format. Common causes: a wrong header, a namespace other than http://www.sitemaps.org/schemas/sitemap/0.9, or curly quotes around attributes, which word processors can insert.Writes the XML declaration and namespace itself. If you edit the file, use a plain-text editor.
Path mismatch: Missing wwwThe sitemap URL has no www, but the URLs it lists do. Make them match.URLs carry the host of the site you crawled. Upload the file on that same host.
Path mismatch: Includes wwwThe sitemap URL has www, but the URLs it lists do not. Make them match.URLs carry the host of the site you crawled. Upload the file on that same host.
Incorrect namespaceThe root element has a wrong, misspelled or badly declared namespace. A sitemap uses xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"; a video sitemap adds xmlns:video="http://www.google.com/schemas/sitemap-video/1.1".Writes the namespace for each file type it generates.
Leading whitespaceThe file starts with whitespace instead of the XML declaration. Google still processes the sitemap, but remove it to follow the XML standard.The file starts with the XML declaration.
HTTP error [specific code]Google got a 400-level HTTP error downloading the sitemap, and the message shows the code. Check the URL and that the file exists there, then resubmit.Check the path where you uploaded the file.
General HTTP errorAnother HTTP error. Expand the details to see which. It can also be a 404, which is a fetch error.Check the path where you uploaded the file.
Sitemap contains urls which are blocked by robots.txtrobots.txt blocks the sitemap or some content in it. Use the URL Inspection tool to find which file is blocked, then edit robots.txt to let Googlebot in.Its crawler checks robots.txt before fetching a page. Test any URL with the robots.txt tester.

Video and news sitemap errors

Video and news sitemap errors in Search Console and their fixes
MessageCause and fix (Google)
Missing thumbnail URLA video entry has no thumbnail URL. Add it with the video:thumbnail_loc tag.
Missing video titleA video entry has no title. Add it with the video:title tag.
Thumbnail too largeThe video thumbnail is too large. Resize it to 160 x 120 px.
Thumbnail too smallThe video thumbnail is too small. Resize it to 160 x 120 px.
Video location and play page location are the sameIf you give both video:player_loc and video:content_loc, the two URLs must differ.
Video location URL appears to be a play page URLThe video:content_loc URL points to the page that hosts the player. Point it to the video file.
Too many News URLsA news sitemap lists more than 1,000 URLs. Reduce the URLs per file.
Missing <publication> tagEach URL in a news sitemap needs a publication tag. Add it to every URL.

How to avoid sitemap errors in the first place

Most of the rows above describe a hand-edited file or a file in the wrong place. A generator removes the first cause. GenMap writes the XML with the right declaration and namespace, escapes special characters, formats lastmod in W3C format or omits it, splits files above 50,000 URLs and builds the index. It also lists only pages that return 200, are not marked noindex and are their own canonical, so redirects, errors and duplicates never reach the file.

Where you upload the file is up to you, and that covers the remaining errors: path, host and robots.txt rules. Check a file before you submit it with the sitemap validator and the robots.txt tester, both free. The XML sitemap guide explains the format.

Sources

Start from a sitemap that is built to pass the report.

Crawl a site