How to validate an XML sitemap
To validate an XML sitemap or sitemap index, submit its public URL and review the protocol and date checks.
- Enter the full URL of your sitemap (for example,
https://example.com/sitemap.xmlorhttps://example.com/sitemap_index.xml) in the Sitemap URL field. If you enter a bare domain root, SolViewer automatically appends/sitemap.xml. - Select Check Sitemap to fetch the XML document (up to 50 MiB) and run the parser.
- Check the delivery and root rows first:
HTTP 200,XML content type,UTF-8 encoding,Valid XML,Sitemap root,Sitemap type, andSitemap namespace. - Inspect the location and date rows (
Required loc values,Absolute URLs,Host consistency,Last modified dates, andBounded child sitemap validation), then review the first 20 locations in the URL sample or Sitemap sample list.
Reading your results
XML Sitemap Checker evaluates your file against the official sitemaps.org 0.9 specification and Google Search Central's sitemap requirements. Here is what each diagnostic row verifies:
| Check title | Basis | Pass / Warn / Fail criteria in the analyzer |
|---|---|---|
HTTP 200 & XML content type |
Protocol / Best practice | HTTP 2xx passes; any other status fails. XML content type passes when the Content-Type header matches application/xml, text/xml, or *+xml, and warns if the header is missing or text/html. |
UTF-8 encoding & Valid XML |
Protocol requirement | Fails if the byte stream contains invalid UTF-8 sequences or if DOMParser encounters an XML <parsererror> (such as unescaped & characters or unclosed tags). |
Sitemap root & Sitemap type |
Protocol / Info | Requires a root element of <urlset> or <sitemapindex>. Sitemap type classifies the file as a Standard URL sitemap, a Sitemap index containing child sitemap locations, or a URL sitemap with extensions (counting image, video, and news extension nodes). |
Sitemap namespace |
Protocol requirement | Passes when the root element declares xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"; warns if the namespace is missing or misspelled. |
URLs found / Sitemaps found & Required loc values |
Protocol requirement | Counts direct-child <url> nodes (inside <urlset>) or <sitemap> nodes (inside <sitemapindex>) in the same namespace, and fails if any entry is missing a direct <loc> child. |
Absolute URLs, URL length, Host consistency, Unique entries |
Protocol / Best practice | Fails if any <loc> is relative (such as /about) or reaches 2,048 characters. Warns if entries point to a different hostname than the sitemap or if duplicate <loc> URLs exist. |
Entry limit & Uncompressed size limit |
Protocol requirement | Fails if a single file exceeds 50,000 locations or 50 MiB (52,428,800 bytes) uncompressed. |
Last modified dates |
Google guidance | Validates every <lastmod> value with strict calendar math. Warns if any date is malformed or impossible (such as 2026-02-30). Omitting <lastmod> passes. |
Bounded child sitemap validation |
Best practice | Displayed when the root is <sitemapindex>. Fetches up to 12 eligible child sitemaps (up to 2 MiB per child) and verifies that each child returns valid XML, a valid root/namespace, valid URLs, and valid dates. |
Capability boundary: This tool validates the XML structure, dates, and up to 12 child sitemaps of a sitemap index. It does not crawl the individual HTML webpages listed inside <url><loc> tags and cannot confirm whether Google has indexed those pages.
Worked example: Standard URL sitemap vs. Sitemap index
Search engines accept two distinct XML root structures. Mixing their tags—or using invalid date formats—causes Search Console to reject the submission. Compare these two valid templates:
<!-- 1. Standard URL Sitemap (<urlset>) -->
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/seo-checker/</loc>
<lastmod>2026-09-25T09:48:00+00:00</lastmod>
</url>
</urlset>
<!-- 2. Sitemap Index (<sitemapindex>) -->
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2026-09-25</lastmod>
</sitemap>
</sitemapindex>
When XML Sitemap Checker inspects the second file (<sitemapindex>), here is what happens step by step:
- Root & direct-child matching: It confirms the root is
sitemapindexunder thehttp://www.sitemaps.org/schemas/sitemap/0.9namespace and looks strictly for direct<sitemap>children (ignoring any stray<url>tags). - Strict calendar validation (
validateSitemapDate): It parses2026-09-25into year, month, and day, checks `Date.UTC(year, month, 0)` to ensure the day exists on the calendar, and verifies any W3C time and timezone offset (rejecting impossible offsets beyond+14:00). - Bounded child probing: Because the file is a sitemap index, the checker queues up to 12 child
<loc>URLs (such ashttps://example.com/sitemap-pages.xml) with a concurrency of 4 workers and verifies that each child is itself a valid, well-formed XML sitemap.
Fixing 'Sitemap is HTML' and invalid lastmod dates
Two issues account for the majority of sitemap errors in Google Search Console: "Sitemap can be read, but has errors: Sitemap is HTML" and ignored or rejected <lastmod> timestamps.
| Error pattern | What Search Console & SolViewer see | Root cause | Exact fix |
|---|---|---|---|
| Sitemap is HTML | XML content type warns (text/html), and Valid XML or Sitemap root fails (root is <html> instead of <urlset>). |
A trailing-slash redirect, CDN firewall challenge, login redirect, or SPA fallback route served an HTML page at the sitemap URL. | Exempt /sitemap*.xml from SPA rewrite rules and bot challenges, and serve raw XML with Content-Type: application/xml; charset=utf-8. |
| Unescaped ampersands in URLs | Valid XML fails with an XML parser error before any URLs can be counted. |
A query URL inside <loc> contains a raw & (for example, ?page=1&sort=asc) instead of an XML entity. |
Entity-escape reserved XML characters inside <loc>: replace & with &, ' with ', and " with ". |
Malformed <lastmod> |
Last modified dates warns that values are not real YYYY-MM-DD dates or complete W3C datetimes. |
CMS output a human date (Sep 25, 2026), a Unix epoch integer, an incomplete time without a timezone (2026-09-25T12:00:00), or an impossible calendar date (2026-02-29). |
Format dates strictly as YYYY-MM-DD or YYYY-MM-DDThh:mm:ss+00:00 (or Z). Omit <lastmod> entirely if you do not track real content edits. |
<url> tags inside <sitemapindex> |
Sitemaps found reports 0 direct locations found and fails. |
A sitemap index mixed webpage <url> items with child <sitemap> items. |
Keep webpage URLs inside <urlset><url> files and point <sitemapindex><sitemap> entries only to child XML sitemap files. |
Common problems and fixes
Use these solutions when addressing specific warnings in your sitemap report:
Sitemap namespacewarns even though the XML parses.
Cause: The root element useshttps://instead ofhttp://in the namespace URI, or omits thexmlnsattribute entirely.
Fix: Always use the exact string required by the protocol:<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">Absolute URLsfails on relative paths.
Cause: Entries were written as<loc>/products/widget</loc>instead of full URLs.
Fix: Prepend the canonical scheme and hostname (https://example.com/products/widget) to every<loc>element. Sitemaps do not resolve relative URLs.Host consistencywarns about cross-host entries.
Cause: Your sitemap athttps://example.com/sitemap.xmllists URLs onhttps://www.example.com/, a staging domain, or a separate CDN host.
Fix: Match every<loc>hostname to the canonical host of the sitemap, or verify ownership of both properties in Search Console and declare the cross-host setup inrobots.txt.Entry limitorUncompressed size limitfails on a large site.
Cause: The file contains more than 50,000 URLs or exceeds 50 MiB uncompressed.
Fix: Split your URLs into smaller category or paginated sitemaps (for example,sitemap-products-1.xml,sitemap-products-2.xml) and reference them inside a parent<sitemapindex>file, following Google's guide on managing large sitemaps.- Changing
<priority>or<changefreq>had zero effect on crawling.
Cause: Google officially ignores both<priority>and<changefreq>in XML sitemaps.
Fix: Stop tuning priority numbers. Focus on keeping<loc>URLs canonical (HTTP 200, indexable) and updating<lastmod>only when page content meaningfully changes.
How this check works
XML Sitemap Checker fetches the target URL (allowing up to 50 MiB for a primary sitemap request), checks UTF-8 byte integrity, and parses the document with DOMParser in application/xml mode. It inspects the root tag and namespace URI, extracts direct child entries, and checks every <loc> for protocol validity, 2,048-character length limits, host consistency, and duplicates.
Date strings inside <lastmod> are verified by validateSitemapDate against W3C Datetime rules and UTC calendar days per month. When the root is <sitemapindex>, the checker runs up to 4 concurrent workers to fetch a bounded sample of up to 12 child sitemaps (up to 2 MiB per child) and validates each child's XML structure. All rules follow the sitemaps.org protocol and Google's Build and submit a sitemap documentation.
All network requests follow the SolViewer public retrieval limits.
Frequently asked questions
What is the exact format required for lastmod in an XML sitemap?
Use a complete calendar date (YYYY-MM-DD, such as 2026-09-25) or a full W3C datetime with a timezone designator (YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DDThh:mm:ss+00:00). Partial dates like YYYY-MM, timestamps missing a timezone offset, or impossible calendar days will trigger a warning.
Should I include lastmod if my static generator stamps the build time on every URL?
No. Google's documentation states that it uses <lastmod> only when the date is consistently and verifiably accurate. Stamping the current deployment timestamp onto unchanged pages reduces trust in your <lastmod> signal; omit the tag if you only know the build time.
Does Google use the priority or changefreq tags in sitemaps?
No. Google Search ignores both <priority> and <changefreq>. SolViewer does not score or penalize those tags.
Why does Bounded child sitemap validation check at most 12 child sitemaps?
Large sites often list dozens or hundreds of child files in a sitemap index. Sampling up to 12 child sitemaps (at up to 2 MiB each) verifies whether your sitemap generator produces valid child XML without overwhelming your origin server. You can paste any individual child sitemap URL directly into this tool to validate it in full.
Does a 100/100 sitemap score mean all my URLs are indexable?
No. A 100/100 score confirms that the XML file itself is well-formed and follows the sitemaps.org specification. If the listed URLs redirect, return 404, or carry a noindex tag, you must audit those pages individually with the SEO Checker.
Related tools
- Robots.txt Checker — verify that your
/robots.txtfile declares your sitemap URL and does not accidentally disallow the paths listed in your sitemap. - SEO Checker — audit individual URLs from your sitemap to confirm they return HTTP 200, self-referencing canonicals, and indexable directives.
- HTTP Header Checker — inspect the exact
Content-Typeheader and redirect chain when a sitemap URL fails to load as XML. - View Source — inspect the raw XML or HTML text returned by any public endpoint with line numbers.
Public URL requests follow the shared fetch limits on the About page.