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
| Error | Cause | Fix |
|---|---|---|
| Unescaped special characters | Raw & instead of & in URLs | URL-encode or escape all special characters |
| Missing xmlns namespace | Root <urlset> tag lacks the schema declaration | Add xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" |
| Relative URLs | Entries like /page instead of https://example.com/page | Always use fully-qualified absolute URLs |
| Mixed http/https | Some URLs use http, canonical site is https | Ensure every URL matches your canonical protocol |
| Wrong content-type | Server returns text/html instead of application/xml | Configure server/CMS to serve the correct MIME type |
| Sitemap is HTML | A CMS route returns an error page instead of XML | Check the sitemap URL loads raw XML, not a rendered page |
A Simple Validation Checklist
- Confirm the file loads as raw XML in a browser, not an HTML error page.
- Run it through an XML validator to catch structural errors.
- Check URL count and file size are under the 50,000 / 50 MB limits.
- Spot-check a handful of URLs — are they absolute, correctly protocol-matched, and live?
- Submit to Google Search Console and check the processing status after a day.
- Run a full crawl of every listed URL to catch 404s and redirects the above steps can't see.