Free tool
Validate your XML sitemap
Check a sitemap or sitemap index against the protocol and Google's rules, then see whether the URLs it lists actually load, stay put and can be indexed.
What the validator checks
Is it a valid sitemap?
- Well-formed XML
- The file parses, with the line and column of the first error. An unescaped & in a URL is the usual culprit.
- Root and namespace
- A <urlset> or <sitemapindex> root with the sitemaps.org namespace. Catches HTML pages served as sitemap.xml.
- Protocol limits
- At most 50,000 URLs and 50 MB uncompressed per file. Gzipped sitemaps are unzipped first.
Are the URLs right?
- Absolute, same host
- Every <loc> is a full URL on the sitemap's host and protocol, under the sitemap's folder, under 2,048 characters.
- No duplicates
- Each URL once, and no pairs that differ only by a trailing slash or letter case.
- Listed URLs work
- Up to 20 sampled URLs: redirects, 4xx and 5xx, noindex, a canonical pointing elsewhere, or blocked by robots.txt.
Are the dates useful?
- W3C Datetime
- lastmod as YYYY-MM-DD or a full timestamp with a time zone.
- Not in the future
- A lastmod later than today is a sign the dates aren't real.
- Not all the same
- Identical dates on every URL usually mean the build time was written for every page.
Sitemap indexes
- Child sitemaps
- Every listed sitemap, with up to 5 of them validated in full, spread across the index.
- No nesting
- An index should list sitemaps, not other indexes.
- Found from robots.txt
- Enter just your domain: the validator reads the Sitemap lines in robots.txt, then tries /sitemap.xml.
The rules it follows
The checks come from the sitemaps.org protocol and Google's guides to building a sitemap and sitemap index files. Errors break the file or the protocol. Warnings are things Google tolerates but that waste crawling or hide the URLs you care about. Notes, like changefreq and priority, are harmless.
Sampled URLs are fetched once each, without following redirects, and only where robots.txt allows Serpkin's crawler. URLs closed to Googlebot are reported without being fetched.
Fix what it finds
- GuideSitemaps in Next.jsGenerate an accurate sitemap with app/sitemap.ts, with real lastmod dates.
- GuideDiscovered, currently not indexedWhy Google knows a URL but hasn't indexed it, and what to change.
- GuideCanonical tags, explainedKeep your sitemap, redirects and canonicals pointing at the same URL.
- Free toolRobots.txt testerCheck that robots.txt declares your sitemap and doesn't block listed URLs.
Questions
How do I check if my sitemap is valid?
Enter the sitemap URL above, or just your domain. The validator parses the XML, checks it against the sitemaps.org protocol and Google's sitemap guidelines, and samples up to 20 listed URLs to see whether they load and can be indexed. After fixing problems, submit the sitemap in Search Console's Sitemaps report to see when Google last read it.
How many URLs can a sitemap have?
At most 50,000 URLs and 50 MB uncompressed per sitemap file. For more, split the URLs across several sitemaps and list them in a sitemap index, which can itself list up to 50,000 sitemaps. Gzip compression saves bandwidth, but the 50 MB limit applies to the unzipped file.
Does Google use lastmod, changefreq and priority?
Google ignores changefreq and priority. It uses lastmod when the value is consistently and verifiably accurate, for example when it matches the last significant change to the page. Writing the build time on every URL teaches Google to ignore your dates.
Should a sitemap include URLs that redirect or are noindex?
No. List only the canonical URLs you want in search: pages that return 200, have no noindex and aren't blocked by robots.txt. Redirecting, broken and noindex URLs in a sitemap send mixed signals about which URLs matter, and waste crawls.
Where should the sitemap be and how do search engines find it?
Usually at the root, such as https://example.com/sitemap.xml, because a sitemap may only list URLs in its own folder and below. Add a Sitemap line with the full URL to robots.txt so every crawler finds it, and submit it in Search Console and Bing Webmaster Tools.