Common Sitemap Errors and Fixes

Submitting an XML sitemap to Google Search Console (GSC) is usually a smooth process, but when errors occur, they can halt your site's indexation. Here is a guide to diagnosing and fixing the most common sitemap errors.

Error: "Couldn't Fetch"

This incredibly common (and frustrating) error usually means Google couldn't establish a connection to read the file.

  • Server Block/Firewall: Ensure your server or CDN (like Cloudflare) isn't accidentally blocking Googlebot's IP addresses.
  • Robots.txt Block: Check if your robots.txt file is disallowing crawling of the directory where the sitemap lives.
  • Temporary Glitch: Often, this is a transient bug on Google's end. If the URL works perfectly in your browser, try submitting it again the next day.

Error: "Invalid XML" or "Incorrect Namespace"

This means your file isn't formatted correctly according to the strict XML protocol.

  • Missing Tags: Ensure every <url> has a closing </url> tag, and the document ends with </urlset>.
  • Unescaped Characters: XML is very strict about special characters in URLs. An ampersand (&) must be written as &amp;. A single quote (') must be &apos;. Use a proper generator tool to handle this automatically.

Error: "URLs not accessible"

Google parsed the sitemap but found that the URLs listed inside it return errors.

  • 404 Not Found: The URLs in the sitemap no longer exist. Remove them.
  • 500 Server Error: Your server crashed when Googlebot tried to load the pages.

Error: "Sitemap is HTML"

You submitted an HTML webpage instead of an XML file. This usually happens if your CMS incorrectly routes the sitemap.xml URL to a custom 404 page, or if you accidentally submitted the URL of your human-facing HTML sitemap.

Error: "Path mismatch"

A sitemap can only include URLs that are in the same directory (or subdirectories) as the sitemap itself. If your sitemap is located at https://example.com/blog/sitemap.xml, it cannot contain URLs from https://example.com/products/. The solution is to place your sitemap in the root directory (https://example.com/sitemap.xml).

Optimize Your Site Today

Apply these SEO principles by generating a clean, protocol-compliant XML sitemap.

Go to Generator Tool