Free Tool
XML Sitemap Validator
Validate your XML sitemap structure, check URL count limits, lastmod format, and flag potential issues that affect URL discovery and crawlability.
What is an XML sitemap?
An XML sitemap is a file that lists the URLs you want search engines to discover and crawl. It provides metadata about each URL — such as when it was last modified, how frequently it changes, and its relative priority — to help search engines crawl your site more efficiently.
A sitemap is a discovery aid, not a guarantee of indexing or ranking. It helps search engines find pages they might otherwise miss, but search engines still decide whether to index and rank those pages based on content quality, relevance, and technical accessibility. Learn how sitemaps fit into broader technical SEO.
What should an XML sitemap contain?
- Canonical URLs — Include the URLs you want search engines to index, matching your canonical signals.
- Properly formatted URLs — Use full, absolute URLs with the correct protocol (HTTPS).
- Valid XML — The sitemap must be well-formed XML with the correct namespace.
- Appropriate structure — Use
<urlset>for URL sitemaps and<sitemapindex>for sitemap index files.
Do not include redirected URLs, noindex pages, duplicate versions, or URLs blocked by robots.txt. A clean sitemap helps search engines focus on your most important pages and avoids wasting crawl budget.
XML sitemap vs sitemap index
A URL sitemap lists individual URLs. A sitemap index is a file that references multiple individual sitemaps. Use a sitemap index when your site has more than 50,000 URLs or when you want to organize sitemaps by content type.
sitemap-index.xml
→ sitemap-posts.xml (blog posts)
→ sitemap-pages.xml (static pages)
→ sitemap-products.xml (product pages)A sitemap index can reference up to 50,000 individual sitemaps, and each sitemap can contain up to 50,000 URLs — allowing up to 2.5 billion URLs total.
Common sitemap errors
- Malformed XML — Missing closing tags, incorrect encoding, or invalid XML structure prevent search engines from parsing the sitemap.
- Invalid URLs — URLs that do not resolve or return errors waste crawler time.
- Inaccessible sitemap — If the sitemap itself returns an error or is blocked by robots.txt, search engines cannot read it.
- HTTP URLs on an HTTPS site — Sitemap URLs should match your canonical protocol.
- Redirects in sitemap URLs — Include the final destination URL, not one that redirects.
- Non-canonical URLs — Sitemap URLs should match your canonical URLs.
- Duplicate URLs — Listing the same URL multiple times provides no benefit.
- Blocked URLs — URLs blocked by robots.txt should not be in the sitemap.
- Stale URLs — Remove URLs for pages that no longer exist.
Sitemap and canonicalization
The URLs in your sitemap should be consistent with your canonical signals. If a sitemap lists a URL whose canonical tag points to a different URL, you are sending conflicting signals — the sitemap says "discover this URL" while the canonical tag says "the preferred version is over there."
Ensure sitemap URLs and canonical tags point to the same preferred versions. Check your canonical implementation with the Canonical Tag Checker.
Sitemap and robots.txt
You can declare your sitemap location in robots.txt using the Sitemap directive. This is optional but useful — it allows search engines to discover your sitemap without manual submission:
Sitemap: https://example.com/sitemap.xmlThe Sitemap directive is independent of the Allow/Disallow rules in robots.txt. Even if paths are blocked for crawling, the sitemap can still be declared. However, URLs in the sitemap that are blocked by robots.txt will not be crawled. Check your robots.txt with the Robots.txt Checker.
Sitemaps and search visibility
A clean, accurate sitemap helps search engines discover your important URLs, which is part of the technical foundation for search visibility. However, submitting a sitemap does not guarantee that URLs will be indexed or ranked — that depends on many factors including content quality, relevance, and indexability.
For large or complex sites, a well-maintained sitemap is especially valuable because it ensures search engines can find pages that might not be easily discovered through normal crawling. Learn how SEO audits can help identify sitemap and crawlability issues.
Why this matters
An XML sitemap is a discovery aid that helps search engines find your pages. An invalid, oversized, or stale sitemap can waste crawl budget, mislead crawlers, or prevent important pages from being discovered. A clean, accurate sitemap is part of the technical foundation for search visibility.
Related glossary terms
Frequently Asked Questions
An XML sitemap is a file that lists the URLs you want search engines to discover and crawl. It provides metadata about each URL such as when it was last modified and how frequently it changes. A sitemap is a discovery aid — it does not guarantee indexing or ranking.
A single sitemap can contain up to 50,000 URLs and be no larger than 50MB uncompressed. For larger sites, use a sitemap index file that references multiple sitemaps, each containing a subset of your URLs.
A sitemap index is an XML file that references multiple individual sitemaps. It is useful when your site has more than 50,000 URLs or when you want to organize sitemaps by content type — for example, separate sitemaps for posts, pages, and products.
Google uses the lastmod tag to determine when a page was last modified and may prioritize crawling accordingly. Use accurate, ISO 8601 formatted dates. Inaccurate or stale lastmod values can reduce crawl efficiency because search engines may lose trust in the signal.
Include canonical, indexable URLs that you want search engines to discover. Do not include redirected URLs, noindex pages, duplicate versions, or URLs blocked by robots.txt. A clean sitemap helps search engines focus on your most important pages.
Yes. The URLs in your sitemap should match your canonical URLs. If a sitemap lists a URL whose canonical tag points to a different URL, you are sending conflicting signals. Ensure sitemap URLs and canonical tags point to the same preferred versions.
Yes. You can declare your sitemap location in robots.txt using the Sitemap directive. This is optional but useful — it allows search engines to discover your sitemap without submitting it manually. The Sitemap directive is independent of the Allow/Disallow rules in robots.txt.
No. A sitemap is a discovery aid, not a ranking signal. Submitting a sitemap helps search engines find your pages, but it does not guarantee they will be indexed or ranked. Indexing and ranking depend on many factors including content quality, relevance, and technical accessibility.
Related articles
Related tools
Let's talk
Your next customer might not click a blue link — they'll ask an AI. Be the answer.
Book a free strategy call and I'll audit your visibility across Google, AI Overviews, ChatGPT, and Perplexity — then map out exactly what it takes to be found and cited.