All posts
How-To Guides

How to Validate a Sitemap (And Catch Errors Before Google Does)

A malformed sitemap can get rejected entirely by search engines. Here are four ways to validate yours, and the most common errors to check for.

July 2, 2026·5 min read

A sitemap is only useful if search engines can actually parse it. A single malformed tag, unescaped character, or wrong content-type header can cause the entire file to be rejected — not just the one bad entry. Validating your sitemap before submitting it catches these problems early.

Method 1 — Google Search Console

The most authoritative check, because it tells you exactly what Google sees. Go to Indexing → Sitemaps, submit your sitemap URL, and check its status after Google processes it. A successful validation shows "Success" with a count of discovered URLs. Errors appear as specific messages — "Couldn't fetch", "Sitemap is HTML", or "Invalid XML" — that point you toward the actual problem.

Method 2 — XML Schema Validation

Before submitting anywhere, check that the file is well-formed XML and matches the sitemap schema. Any XML validator will catch structural problems — unclosed tags, invalid nesting, missing the required xmlns namespace declaration on the root element. This is the fastest check to run and catches the most common class of error — a typo or copy-paste mistake that breaks the whole file.

Method 3 — Online Sitemap Validators

Dedicated sitemap validation tools go one level further than generic XML validation — they check sitemap-specific rules like the 50,000 URL / 50 MB limits, correct date formatting in <lastmod>, and whether URLs are absolute rather than relative. Paste in your sitemap URL and it will flag issues that pure XML validation misses.

Method 4 — Crawl Every URL in the Sitemap

Structural validity doesn't mean the sitemap is actually correct. A perfectly well-formed sitemap can still list URLs that 404, redirect, or return server errors. The only way to catch this is to crawl every URL and check its live HTTP status — this is what a sitemap health check does, and it's the validation layer that structural checks and Search Console's parse-level check can't cover.

Common Sitemap Errors

ErrorCauseFix
Unescaped special charactersRaw & instead of &amp; in URLsURL-encode or escape all special characters
Missing xmlns namespaceRoot <urlset> tag lacks the schema declarationAdd xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
Relative URLsEntries like /page instead of https://example.com/pageAlways use fully-qualified absolute URLs
Mixed http/httpsSome URLs use http, canonical site is httpsEnsure every URL matches your canonical protocol
Wrong content-typeServer returns text/html instead of application/xmlConfigure server/CMS to serve the correct MIME type
Sitemap is HTMLA CMS route returns an error page instead of XMLCheck the sitemap URL loads raw XML, not a rendered page

A Simple Validation Checklist

  1. Confirm the file loads as raw XML in a browser, not an HTML error page.
  2. Run it through an XML validator to catch structural errors.
  3. Check URL count and file size are under the 50,000 / 50 MB limits.
  4. Spot-check a handful of URLs — are they absolute, correctly protocol-matched, and live?
  5. Submit to Google Search Console and check the processing status after a day.
  6. Run a full crawl of every listed URL to catch 404s and redirects the above steps can't see.

Try it free

Generate and check your sitemap in minutes

Crawl up to 2,000 URLs for free — no credit card required. See your health score and download your sitemap XML instantly.

Generate your sitemap →