The short answer
An XML sitemap is a file that lists the URLs on your site you want search engines to discover. It is a discovery hint, not an indexing command. Submitting a URL in your sitemap tells Google the page exists and is worth crawling; it never forces the page into the index. Google decides indexing separately, based on quality, canonicalization, and crawl signals, and Google Search Central states plainly that using a sitemap does not guarantee that every item in it will be crawled and indexed.
That distinction changes how you think about sitemap hygiene. Search Console reports the ratio of submitted URLs to indexed URLs, so a sitemap stuffed with thin, redirected, or noindexed pages erodes trust in the whole file. A clean sitemap of canonical, 200-status, indexable URLs is a stronger signal than most people treat it as. This guide covers the rules that matter in 2026, and where the old advice (changefreq, priority) has quietly stopped mattering.
An XML sitemap is one layer of your technical SEO foundation, working alongside how search engines handle crawling and indexing and what you allow through robots.txt.
Do you actually need a sitemap?
Google finds pages by following links, so a sitemap matters most when internal linking alone won't surface everything. Google's own guidance says you probably need one if your site is large, new with few external links, or has content that is isolated or poorly linked internally. Specifically, you need one when:
- Your site runs to thousands of URLs and new or deep pages are hard to reach by crawling.
- Your site is new or has few external backlinks, so Googlebot has little to follow.
- You have orphaned pages or content with weak internal links.
- You publish rich media (video, images, news) that benefits from sitemap extensions.
A small, well-linked ten-page brochure site technically doesn't need one. Almost everything else benefits, and the cost of a correct sitemap is near zero.
The rules that matter
Size limits: 50,000 URLs and 50MB
A single sitemap file is capped at 50,000 URLs or 50MB uncompressed, whichever comes first, per Google's build-and-submit guidelines. You can gzip the file to save bandwidth, but the 50MB limit applies to the uncompressed size. Hit either ceiling and you split the file, then reference the parts from a sitemap index (below). The sitemaps.org protocol spec documents the same limits, since the format predates Google's adoption of it.
Only canonical, 200-status, indexable URLs
This is the single most important rule. Every URL in your sitemap should be:
- Canonical — the version you want indexed, not a parameter variant or duplicate. If you use canonical tags, the URL in the sitemap must match the canonical you declare.
- Status 200 — no redirects (3xx), no 404s, no soft 404s.
- Indexable — not blocked by robots.txt and not carrying a noindex tag.
Mixing noindexed or redirected URLs into your sitemap sends contradictory signals: you're asking Google to crawl a page you've simultaneously told it not to index. At scale, a low submitted-to-indexed ratio suggests your sitemap is unreliable, which is the opposite of what the file is for.
Honest lastmod, and skip changefreq and priority
The lastmod date should reflect the last significant change to a page's content, not a build timestamp that updates on every deploy. Google's documentation is explicit that it uses lastmod only when the value is consistently and verifiably accurate, and that significant edits (main content, structured data, links) warrant a new timestamp while a copyright-year bump does not. If every URL claims it was modified today, Google learns to ignore the field entirely.
Two tags you can drop: changefreq and priority. Google confirms it ignores both. They add bytes and maintenance for zero benefit. A modern sitemap needs the URL and, where genuinely accurate, lastmod. That's it.
Absolute URLs and UTF-8
Use full absolute URLs (https://example.com/page, not /page) and UTF-8 encoding. List only URLs on the same site the sitemap serves. A sitemap at example.com can't declare URLs on another domain unless the domain is verified for cross-submission in Search Console.
Sitemap index files: split by section
Once you have more than one sitemap file, because you exceeded 50,000 URLs or by choice, you wrap them in a sitemap index file. A sitemap index is a sitemap of sitemaps: one parent file that points to child sitemaps, each of which lists actual URLs.
The move most people miss is splitting by template or section rather than arbitrarily:
| Child sitemap | Contains |
|---|---|
| sitemap-products.xml | Product pages |
| sitemap-blog.xml | Blog posts |
| sitemap-categories.xml | Category and collection pages |
| sitemap-static.xml | About, contact, policy pages |
When you split this way, Search Console's coverage reporting becomes a per-template diagnostic. If your products sitemap shows 40,000 submitted but only 12,000 indexed, you've localized a quality or duplication problem to one template instead of hunting across the whole site. That turns the Pages report into a real troubleshooting tool. A thorough technical SEO audit leans on exactly this kind of segmentation.
Dynamic sitemaps
For any site where content changes, an ecommerce catalog, a publisher, a marketplace, generate the sitemap from your database or CMS rather than maintaining a static file by hand. A dynamic sitemap regenerates on publish, drops removed URLs, and keeps lastmod honest automatically. Most modern frameworks and CMS platforms ship this out of the box or via a plugin. The catch: the generator must apply the same rules, excluding noindexed and non-canonical URLs at generation time, not after the fact.
Video and image sitemaps
Standard sitemaps can carry extensions for media. Image sitemaps add image URLs to a page entry; video sitemaps add metadata like title, description, duration, and thumbnail. These help Google discover media it might not parse from your HTML, which matters for image and video search visibility.
That said, Google now notes that structured data and standard crawling often surface media without a dedicated sitemap, per its video sitemaps guidance. Use media sitemaps when you have a large media library or when video is core to your traffic; otherwise well-marked-up pages with schema markup usually suffice. If you run a multilingual site, note that hreflang annotations can also live in sitemaps; see the hreflang guide for the trade-offs versus HTML tags.
How to submit your sitemap to Google
Google documents four methods; three matter for most sites, per Google's sitemap documentation:
- Search Console Sitemaps report — paste your sitemap URL and submit. This is also where you monitor the submitted-versus-indexed counts over time. If you connect your Search Console data, you can track that ratio without logging into the console daily.
- robots.txt reference — add a line reading Sitemap: https://example.com/sitemap.xml. Every compliant crawler reads it, and it requires no per-engine submission.
- Search Console API — for automated, programmatic submission at scale.
Do both the first two. The robots.txt line ensures every search engine finds it; the Search Console submission gives you the reporting.
A note on JavaScript-rendered sites
If your URLs are generated dynamically or your sitemap is served through client-side rendering, make sure the sitemap file itself is a static, crawlable resource served with the correct content type. Sitemaps should never depend on JavaScript execution to be read. This is one of several places where rendering choices intersect with crawlability, covered in more depth in JavaScript SEO. Separately, keeping crawl budget efficient, with fast responses and clean redirects, helps Google process your submitted URLs faster, which connects to Core Web Vitals and broader work on page speed.
Auditing your sitemap
Run this checklist against your current sitemap:
- Does every URL return 200? (No redirects, no 404s.)
- Is every URL the canonical version?
- Are any noindexed or robots-blocked URLs present? (They shouldn't be.)
- Is lastmod accurate, or does it just show the last deploy?
- Are you under 50,000 URLs and 50MB per file?
- Have you removed changefreq and priority?
- Is it split by section for cleaner reporting?
Checking a small sitemap by hand is fine. For thousands of URLs, an automated crawl is the only sane approach. DeployFlare's site audit generates clean sitemaps and flags the dirty URLs polluting yours, the redirected, noindexed, and non-canonical entries dragging down your submitted-to-indexed ratio, so you can see exactly which pages to cut. It's part of a full SEO toolkit that competes with Ahrefs and SEMrush on capability and wins on price, starting at ₹499/month, billed in INR with UPI and GST. You can also start with the free tools.
The sitemap is a small file that does one job well when it's honest: it tells search engines what exists. Keep it clean, keep it accurate, and let the ratio in Search Console tell you where the real indexing problems live.