Common XML Sitemap Errors and How to Fix Them
The most common XML sitemap errors, what causes them, and exact steps to fix each one so search engines and AI answer engines index your pages.
Most XML sitemap errors come from five causes: URLs that return the wrong status code, links to non-canonical or redirected pages, a sitemap that is too big, malformed XML, and a file search engines cannot fetch. Fix those five and almost every sitemap warning in Google Search Console goes away. Below is each error, why it happens, and the exact fix.
What are XML sitemap errors?
An XML sitemap is a file that lists the URLs you want indexed. An error means a crawler tried to read that file or one of its URLs and hit something it did not expect. The sitemap still loads, but the flagged URLs may never get indexed. That matters twice over now. Traditional search skips them, and AI answer engines like ChatGPT and Perplexity skip them too. If your page is not indexed, it cannot be cited, and the answer engine recommends a competitor instead.
Why does my sitemap say 'couldn't fetch'?
This is the most common one and the most misread. 'Couldn't fetch' almost never means the URLs are broken. It usually means one of these:
- The sitemap path is wrong. You submitted /sitemap.xml but the file lives at /sitemap_index.xml.
- Your robots.txt blocks the sitemap path.
- The server returned a 403 or 500 when Google requested the file.
- You submitted the full URL with a typo or an extra slash.
Fix it by opening the sitemap URL in a private browser window. If you see the XML, the file is fine and the problem is the submitted path or a robots.txt block. Resubmit the exact working URL, then use the 'Test' option in Search Console to confirm a live fetch.
URLs returning the wrong status code
A sitemap should only list URLs that return 200 OK. These break that rule:
- 404 and 410 pages. Deleted content still sitting in the sitemap. Remove those URLs from the file.
- Redirected URLs (301 or 302). List the final destination, not the redirect. A sitemap full of redirects wastes crawl budget.
- Noindex pages. If a page has a noindex tag but sits in the sitemap, you are sending mixed signals. Pick one.
- Pages blocked by robots.txt. Do not list a URL you also disallow.
Rule of thumb: every URL in your sitemap should be a live, indexable, canonical, 200-status page. Nothing else belongs there.
Non-canonical and duplicate URLs
Search Console flags this as 'Duplicate, submitted URL not selected as canonical.' It means your sitemap lists a URL that Google thinks is a copy of another page. Usually the sitemap has http and https versions, or trailing-slash and non-slash versions, or URLs with tracking parameters. Fix it by listing only the canonical version of each page, and make sure that URL matches the canonical tag on the page itself. They must agree.
Malformed XML and size limits
Two mechanical errors trip people up:
- Bad syntax. Unescaped ampersands and special characters break the file. Encode & as & in every URL. Validate the file after any manual edit.
- Too large. A single sitemap caps at 50,000 URLs or 50MB uncompressed. Past that, split into multiple sitemaps and link them from a sitemap index file.
- Wrong dates. The lastmod tag must be a valid date. Fake or future dates get ignored and erode trust in the file.
How do I stop these errors coming back?
Manual sitemaps rot. Pages get deleted, URLs change, and the file drifts out of sync. Prevent it:
- Generate the sitemap dynamically from your CMS or framework so it always reflects live pages.
- Exclude noindex, redirected, and paginated URLs at generation time, not after.
- Re-audit after every big content change or migration.
- Keep the sitemap URL stable and referenced in robots.txt.
A clean sitemap is the cheapest indexing win there is. It tells both search engines and AI answer engines exactly which pages to read. If you want the full picture of what indexing means for AI answers, read what is AI visibility, or start a scan now with the Site Audit tool and fix the flagged URLs one by one.