Sitemap Validator: How to Check and Fix Your XML Sitemap
A sitemap validator checks that your XML sitemap is something search engines can actually use: that it’s valid XML with the right namespace, that it’s within the size limits, that its dates are in the right format, and, most importantly, that the URLs inside it are live, canonical pages that return 200 OK. Our free XML sitemap checker finds your sitemap automatically from robots.txt or the usual locations, validates sitemap files and sitemap indexes, and spot-checks up to 200 URLs for errors and redirects.
This guide covers what a sitemap is for, the rules it must follow, how to read the validator’s report, the mistakes we see most often and how to get your sitemap discovered by Google and Bing.
Key takeaways
- A sitemap should list only canonical, indexable URLs that return 200 OK.
- Each sitemap file can hold up to 50,000 URLs and 50 MB uncompressed; larger sites need a sitemap index.
- Accurate
lastmoddates help search engines recrawl updated pages sooner. - Reference your sitemap in robots.txt and submit it in Google Search Console and Bing Webmaster Tools.
What is an XML sitemap?
An XML sitemap is a file that lists the URLs on your website you want search engines to know about, optionally with the date each page last changed. It doesn’t replace good internal linking, but it helps crawlers discover pages faster, especially on new sites, large sites and sites with pages that are hard to reach through links. Google explains the benefits in its sitemaps overview.
Sitemap files vs sitemap indexes
A regular sitemap (<urlset>) lists page URLs. A sitemap index (<sitemapindex>) lists other sitemap files. WordPress SEO plugins usually create an index, such as Yoast’s /sitemap_index.xml, with separate sitemaps for pages, posts and categories.
Does every site need a sitemap?
Small sites with good internal links can be crawled without one, but a sitemap costs nothing and gives search engines a reliable list of your important pages. For sites that add content often, it’s essential.
How to use our sitemap validator
- Enter your domain or the full sitemap URL. If you enter just a domain, the tool looks for
Sitemap:lines in your robots.txt, then tries common locations. - Review the checks: namespace, content type, file size, URL count, duplicates, host mismatches, HTTP URLs and lastmod dates.
- For a sitemap index, click Check next to each child sitemap to validate it in turn.
- Run the spot-check on the first 25, 50, 100 or 200 URLs to find 404s, server errors and redirects.
- Filter the URL list to find specific pages or sections.
- Follow “How to fix it” for prioritised, step-by-step fixes.
The rules every sitemap must follow
Sitemaps follow the sitemaps.org protocol, which Google, Bing and other search engines support. Google adds its own guidance on building and submitting a sitemap.
Format and namespace
The file must be valid UTF-8 XML, and the root element must declare the standard namespace http://www.sitemaps.org/schemas/sitemap/0.9. A typo in the namespace or invalid XML (such as an unescaped ampersand in a URL) can make the whole file unreadable.
Size and URL limits
| Limit | Value | What to do if you exceed it |
|---|---|---|
| URLs per sitemap | 50,000 | Split into several sitemaps listed in an index |
| File size | 50 MB uncompressed | Split the file; gzip compression reduces transfer size |
| Sitemaps per index | 50,000 | Use multiple index files |
Absolute, canonical URLs
Every <loc> must be a full URL including the protocol, on the same host as the sitemap. Use the exact version your site redirects to: HTTPS, with or without www, with or without a trailing slash.
The lastmod tag
lastmod must use W3C date format, such as 2026-11-03 or 2026-11-03T09:30:00+00:00. Google uses it when it’s consistently accurate and ignores changefreq and priority.
What “accurate” means
Update lastmod when the main content changes meaningfully, not when a footer year or a sidebar widget changes. If every URL shows the same date, it looks auto-generated and search engines are likely to ignore it.
Example entry
<url>
<loc>https://example.com/services/local-seo/</loc>
<lastmod>2026-10-21</lastmod>
</url>Understanding your sitemap validator report
Unexpected XML namespace
The root element uses the wrong namespace or none. Regenerate the sitemap with your SEO plugin or fix the root tag.
Wrong content type
Sitemaps should be served as application/xml or text/xml. If your server sends text/html, a plugin or redirect may be returning a web page instead of the file.
Duplicate URLs
Each URL should appear once across all your sitemaps. Duplicates usually come from two plugins generating sitemaps, or from manual additions.
URLs on a different host or using HTTP
These usually indicate a www/non-www or HTTP/HTTPS mismatch after a migration. List only the final versions that return 200.
Invalid or missing lastmod
Fix the date format, or remove lastmod rather than filling it with inaccurate dates.
Spot-check errors
The most valuable part of the report. A URL that returns 404 or 5xx, or redirects, shouldn’t be in your sitemap. Every non-200 URL wastes crawl time and weakens the signal that your sitemap lists your important pages.
The most common sitemap mistakes
1. Listing redirected URLs
After changing URLs, old addresses often stay in a manually maintained sitemap. Replace them with the final URLs. Our 301 redirect checker shows where each one ends up.
2. Including deleted pages
Deleted products and posts that still appear return 404s. Most plugins remove them automatically; custom sitemaps need regenerating.
3. Including non-canonical variants
URLs with tracking parameters, session IDs, filters or sorting options shouldn’t be listed. Only include the canonical version.
4. Two sitemap systems at once
WordPress has a built-in sitemap at /wp-sitemap.xml. Yoast and Rank Math disable it and use their own. If you see both, make sure robots.txt and Search Console point to the one your SEO plugin manages.
5. Blocking the sitemap in robots.txt
If robots.txt disallows the folder your sitemap is in, crawlers may not fetch it. Test the sitemap URL in our robots.txt checker.
6. Forgetting to resubmit after a migration
After moving domains or switching to HTTPS, submit the new sitemap in Search Console for the new property, and keep redirects from old URLs in place.
How to create a sitemap
WordPress
Yoast SEO: Settings → Site features → XML sitemaps (on by default); your sitemap is at /sitemap_index.xml. Rank Math: Sitemap Settings, with the index at /sitemap_index.xml. Without a plugin, WordPress provides /wp-sitemap.xml.
Shopify, Wix and Squarespace
All three generate a sitemap automatically at /sitemap.xml. You can’t edit it directly, but hiding or deleting pages removes them.
Custom websites
Generate the sitemap from your database whenever content changes, rather than by hand. Make sure it includes only published, canonical, indexable pages and writes accurate lastmod dates.
Image, video and hreflang data
Sitemaps can include image and video details and hreflang annotations for international sites. Our validator counts image entries and hreflang links so you can confirm they’re present.
Submitting your sitemap to search engines
Add it to robots.txt
A Sitemap: line in robots.txt lets every search engine find it, not only the ones you submit to.
Sitemap: https://example.com/sitemap_index.xmlCreate or update your file with our robots.txt generator for WordPress.
Google Search Console
Open your property, go to Indexing → Sitemaps, enter the sitemap URL and click Submit. The report shows when Google last read it and how many URLs it discovered. Google’s Sitemaps report help page explains each status.
Bing Webmaster Tools and IndexNow
Submit the same sitemap in Bing Webmaster Tools. Bing’s index also powers Microsoft Copilot and is used by other AI search tools, so it matters more than its market share suggests. Turning on IndexNow notifies Bing and other participating engines the moment you publish or update a page.
How sitemaps affect crawling and indexing
A sitemap is a hint, not a command. Search engines still decide which URLs to crawl and index based on quality, duplication and internal links. Being listed doesn’t guarantee indexing, and pages not listed can still be indexed if they’re linked.
Sitemaps and crawl budget
For small and medium sites, crawl budget is rarely a concern. On large sites, a clean sitemap of only important URLs, combined with fewer errors and redirects, helps search engines spend their crawl on pages that matter.
Sitemaps and AI search
AI-powered search features rely on the same crawled indexes. Fresh lastmod dates and fast discovery through sitemaps and IndexNow help updated content reach those answers sooner.
Troubleshooting Search Console sitemap errors
Google Search Console sometimes reports a sitemap problem without much detail. A sitemap validator helps you find the cause quickly. Here are the most common statuses and what to check.
“Couldn’t fetch”
Google couldn’t download the file. Open the sitemap URL in a private browser window and run it through the validator. Common causes are a typo in the submitted URL, a firewall or security plugin blocking Googlebot, a robots.txt rule covering the sitemap path, or a server error. A brand-new submission can also show this status briefly before Google processes it.
“Sitemap could not be read” or parsing errors
The file was downloaded but isn’t valid XML. Look for HTML being served instead of XML (for example a login page or a cached error page), blank lines or text before the XML declaration (a frequent PHP plugin issue), and unescaped characters such as & in URLs.
“Submitted URL not found (404)” or redirect errors
Pages listed in the sitemap don’t exist or redirect. Run the spot-check in our sitemap validator to list them, then update or regenerate the sitemap so it only contains final URLs.
Fewer URLs indexed than submitted
This is normal to a degree: Google doesn’t index every URL it’s given. If the gap is large, check whether the missing pages are thin, duplicated, noindexed or poorly linked. The Page indexing report in Search Console shows the reason for each excluded URL.
Sitemap validator vs the Search Console report
Search Console shows what Google did with your sitemap after the fact, and it can take days to update. A sitemap validator gives an instant, independent check you can run before submitting and after every change. Use both: validate first, then submit and monitor.
| Our sitemap validator | Search Console sitemaps report | |
|---|---|---|
| Speed | Instant | Hours to days |
| Works on any site | Yes, including competitors | Only verified properties |
| URL status spot-check | Yes, up to 200 URLs | Indirectly, via Page indexing |
| Shows Google’s indexing decisions | No | Yes |
Sitemap checklist
- Valid XML with the standard sitemaps.org namespace.
- Served as XML, under 50 MB uncompressed and 50,000 URLs per file.
- Only canonical, indexable URLs that return 200 OK.
- No duplicates, no tracking parameters, no HTTP or off-host URLs.
- Accurate lastmod dates in W3C format.
- Referenced in robots.txt.
- Submitted in Google Search Console and Bing Webmaster Tools.
- Re-validated after site migrations and major content changes.
Related free SEO tools
- Robots.txt checker: confirm crawlers can reach your sitemap and pages.
- Google index checker: test whether listed URLs can be indexed.
- 301 redirect checker: find the final URL for redirected entries.
- Broken link checker online: find broken links on any page.
- Free SEO checker: audit individual pages in depth.
Ready to test yours? Run the sitemap validator above and spot-check your URLs in under a minute.