Marketing term, content and SEO

XML Sitemap

An XML sitemap is a file that lists the URLs you want search engines to crawl and index, with optional details like last modified date.

Also called: sitemap, sitemap.xml, sitemap index, XML site map

XML Sitemap lives in attract, the part of the funnel about getting found, near related terms like Crawl Budget, Noindex and Canonical Tag (the blue squares).

An XML sitemap is a file that lists the URLs on your site you want search engines to crawl and index, with optional details like when each page last changed. It's a map you hand to crawlers so they don't have to find everything by following links. It helps discovery. It doesn't guarantee indexing.

How it works

The sitemap lives at a URL like /sitemap.xml. You submit it in Google Search Console and reference it in your robots.txt file. Each entry is a URL plus an optional lastmod date. Google has said it uses lastmod when it's consistently accurate and ignores the priority and changefreq fields, so put your effort into honest dates.

Sitemap files have a size cap, so larger sites split URLs across several sitemaps and list them in a sitemap index file. Splitting is useful even below the cap: separate sitemaps per page type let you see indexing rates for each type in Search Console.

Only include URLs you actually want indexed: live, canonical, not set to noindex, not redirected.

A minimal entry looks like this:

<url>
  <loc>https://example.com/glossary/lead-scoring</loc>
  <lastmod>2026-11-27</lastmod>
</url>

Under the sitemaps protocol each file holds up to 50,000 URLs or 50MB uncompressed. Past that, you split into several files and list them in a sitemap index. There are also specialized formats for images, video and news, and international sites can declare hreflang alternates inside the sitemap instead of in every page head.

A sitemap is a hint, not a command. Crawlers still decide what to fetch and what to keep, based on quality, duplication and crawl budget. That is why the sitemap and the robots.txt file have to agree: listing a URL in one and blocking it in the other sends mixed signals.

Example

Say you launch a programmatic SEO project with 3,000 pages on a Next.js site (hypothetical). Instead of one big file, you generate separate sitemaps for integration pages, use-case pages, blog posts and glossary entries, all listed in one index. Two weeks after launch, Search Console shows the integration pages indexing well and the use-case pages mostly sitting in "discovered, currently not indexed." Now you know which template needs work, instead of staring at one blended number for all 3,000.

Next.js can generate sitemaps from a sitemap.ts file, so the sitemap stays in sync with your data automatically.

How to read the sitemap report

Once the sitemap is submitted, the Search Console page indexing report is where it earns its keep. Filter by sitemap and compare submitted URLs with indexed URLs for each page type. A few statuses matter most:

  • Discovered, currently not indexed: Google knows the URL but hasn't crawled it yet. Often a sign of weak internal links or a template that looks thin at scale.
  • Crawled, currently not indexed: Google fetched the page and chose not to keep it. Usually a quality or duplication problem, not a sitemap problem.
  • Excluded by noindex or Alternate page with proper canonical tag: the sitemap is listing URLs it shouldn't, so clean the generator.

A useful rule of thumb: if a page type sits well below the indexing rate of the rest of the site for more than a few weeks after launch, the fix is in the template, the content or the internal linking, not in resubmitting the sitemap. Resubmitting only asks Google to look again at the same pages.

For a full technical SEO review, pair the sitemap with a crawl of the site. URLs that appear in the crawl but not the sitemap are often forgotten pages. URLs in the sitemap with no internal links pointing at them are orphan pages that the sitemap alone will not rescue.

Why it matters for GTM teams

For small sites with good internal links, a sitemap is basic hygiene. For large or fast-growing sites, it's a diagnostic tool. A segmented sitemap turns "our pages aren't indexing" into "this specific template isn't indexing," which is a problem you can actually fix.

Common mistakes

  • Including noindexed, redirected or 404 URLs.
  • Faking lastmod by updating every date on every build.
  • One giant, unsegmented sitemap that hides which page types are struggling.
  • Forgetting to submit it or reference it in robots.txt.
  • Listing URLs that differ from the canonical version, like http instead of https or a missing trailing slash.
  • Including filter, sort or tracking parameter URLs that should never be indexed.
  • Treating the sitemap as a fix for orphan pages instead of linking to them from real pages.

FAQ

Do I need an XML sitemap?

Small sites with strong internal links can be crawled fine without one, but a sitemap costs almost nothing and helps new pages get found faster. For large sites, sites that publish often or programmatic page sets, it is close to required because it is also your best diagnostic for indexing problems by page type.

How many URLs can one sitemap contain?

Under the sitemaps protocol, one file can hold up to 50,000 URLs or 50MB uncompressed, whichever comes first. Bigger sites split their URLs across several sitemaps and list them all in a sitemap index file, which you submit once.

How do I submit a sitemap to Google?

Add the sitemap URL in Google Search Console under the Sitemaps report and add a Sitemap line to your robots.txt file. After that, Google fetches it on its own schedule, so you do not need to resubmit every time it changes.

See all content and SEO terms ↳

Used in these articles