ON THIS PAGE 10 sections
>_ AGENT MODE AI agent? Skip the interface. Read as Markdown
DIRECT ANSWER
Q. What should an XML sitemap contain?
A. An XML sitemap should contain the canonical, indexable, successful URLs a publisher wants search engines to discover and treat as preferred owners, with accurate modification metadata when available. It should normally exclude redirects, client or server errors, noindex resources, duplicate alternates, internal search, and transient parameter states.
EVIDENCE Google limits one sitemap to 50,000 URLs or 50 MB uncompressed and describes sitemap submission as a hint rather than a guarantee of crawling or indexing.

An XML sitemap is not a list of every URL your platform can generate. It is the inventory you are willing to defend as a preferred search document inside a wider technical SEO system.

That framing makes sitemap work much more useful. Instead of asking whether the XML validates, ask whether each listed URL deserves discovery, crawling, canonical ownership, and index consideration.

A citable definition of an XML sitemap

An XML sitemap is a publisher-maintained inventory of preferred URLs and resource metadata supplied to search crawlers for discovery and scheduling.

It proves that the publisher submitted a URL. It does not prove the URL was found through links, fetched successfully, selected as canonical, indexed, ranked, or judged useful.

Google describes sitemap submission as a hint, not a guarantee. This distinction prevents teams from treating “Submitted” as a completed indexing state.

Define the inventory contract

Before generating XML, define the eligibility rule in plain language:

Include a URL when it is the preferred canonical owner, returns a successful indexable response, serves a durable search purpose, and is intended for discovery now.

That rule excludes most common pollution:

  • redirected and broken URLs;
  • noindex pages;
  • canonical alternates;
  • tracking, sorting, session, and duplicate filter states;
  • internal search and account utilities;
  • staging or preview hosts;
  • expired content without a current search purpose;
  • URLs that are not yet released.

The eligibility matrix below joins sitemap membership to evidence that can be retested. “Found in XML” is one field, not the conclusion.

SITEMAP INVENTORY CONTRACT · V2026.07

Submit canonical, indexable owners.

INCLUDE200 + self-canonical + index + valuable
URLHTTPCanonicalDirectiveInlinksDecisionReason
/category/seo/200selfindex42includeCanonical owner with a durable search purpose
/category/seo/?sort=price200/category/seo/index3excludeAlternate state canonicalizes to the owner
/old-guide/3010excludeRedirect target belongs in the sitemap
/account/200selfnoindex8excludePrivate utility page has no search purpose
/new-research/200selfindex12includeNew canonical evidence asset
What the sitemap proves: the publisher submitted this URL and its metadata. What it does not prove: discovery through links, successful crawling, canonical selection, indexing, ranking, or content quality.

Use the standard format and respect the limits

A basic sitemap contains absolute URL locations and optional metadata:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/research/crawl-study/</loc>
    <lastmod>2026-07-18</lastmod>
  </url>
</urlset>

According to Google’s sitemap build documentation, one sitemap is limited to 50,000 URLs or 50 MB uncompressed. Split a larger inventory into multiple sitemaps and list them in a sitemap index.

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemaps/products-1.xml</loc>
    <lastmod>2026-07-18</lastmod>
  </sitemap>
</sitemapindex>

Compress large files when useful, keep them reachable with successful responses, and reference the index or sitemap in robots.txt. Submit the same owner inventory through Search Console where diagnosis benefits from it.

Make lastmod an evidence field

lastmod should represent the last meaningful modification of the resource, not the time the build ran.

A meaningful change can include a revised conclusion, new data, corrected factual content, a substantive product update, or a changed primary image when the image is part of the resource. A rotating footer year, visitor count, build hash, or daily regeneration should not make every URL look new.

Choose a trustworthy source:

  • editorial updatedDate approved with the content change;
  • product record modification time filtered to search-relevant fields;
  • versioned dataset or release timestamp;
  • repository history tied to the page source.

Then test whether the generated value matches visible content and Article or WebPage schema. False freshness destroys the field’s diagnostic value.

For original research and GEO/LLM authority assets, visible versioning matters. A reader should be able to answer what changed, when the evidence was collected, and whether a cited result still describes the current release.

Segment for diagnosis and ownership

Splitting a 5,000-URL site into 50 arbitrary files adds complexity. Segment when the boundary helps someone interpret a result or own a fix.

Useful boundaries include:

  • products, categories, editorial, documentation, and research;
  • languages or regional inventories;
  • release cohorts during a migration;
  • user-generated content versus reviewed owner content;
  • images, video, or news where the specialized sitemap format is justified.

If a product sitemap has 92% indexed coverage and a filter landing-page sitemap has 18%, the split exposes a template decision. If all URLs sit in one file, the aggregate conceals it.

Keep the index stable enough for monitoring. Renaming every sitemap on every deployment makes historical comparison harder.

Sitemap inclusion is itself a canonicalization signal, although weaker than redirects and rel=canonical. List the owner URL and remove alternates.

Then align:

  • internal links and breadcrumbs;
  • redirects and final destinations;
  • HTML or HTTP canonicals;
  • structured-data url, @id, and mainEntityOfPage;
  • hreflang pairs and localized sitemap entries;
  • feeds and discovery endpoints.

The canonical tag guide shows how to test the full signal cluster.

A URL appearing only in a sitemap can be discovered, but that does not make it well integrated. Compare the sitemap inventory with a link-following crawl. URLs present in XML but absent from the crawl are operational orphan candidates and need intent-level review.

Do not mix removal and submission

A sitemap containing a noindex URL sends two different messages: submit this preferred resource, but do not show it. Remove the URL from the sitemap and keep it crawlable until noindex is processed when de-indexing is intended.

A redirecting URL should also leave the sitemap. Include the final canonical target. Keeping old URLs indefinitely because they once earned links makes the inventory less trustworthy and complicates coverage reports.

For deleted content, choose a real treatment: replacement redirect, 404, or 410 depending on the case. A sitemap is not a deletion API.

The robots.txt versus noindex guide separates crawl, index, and access outcomes.

Platform-specific generation risks

WordPress

SEO plugins can generate XML automatically, but their inventory depends on post types, taxonomies, attachment pages, author archives, and plugin settings. Review what the CMS calls public, not only whether /sitemap_index.xml loads.

Exclude noindex templates at the source. Check that modification dates are content dates rather than cache or deployment timestamps. Validate custom post types and translated routes.

WooCommerce

Products, product categories, and genuinely indexable attribute pages may need separate inventories. Cart, checkout, account, internal search, duplicate attributes, and transient filtered states do not.

Stock transitions require a product-lifecycle policy. Do not let a temporary out-of-stock flag silently delete durable product URLs from every discovery surface without considering return likelihood, substitutes, and demand.

Shopify

Shopify generates sitemaps for supported resource types. Audit the resulting product, collection, page, and blog inventory against canonicals, redirects, market/language routes, and the theme’s link graph. Platform generation reduces syntax work; it does not decide which commercial landing pages deserve to exist.

Turn sitemap monitoring into a release check

On every meaningful release, validate:

  1. XML parses and returns the correct content type and status.
  2. Every listed location is absolute and belongs to the intended host.
  3. Listed URLs return the expected successful response.
  4. Listed URLs are indexable and self-canonical.
  5. Redirects, errors, noindex pages, and canonical alternates are absent.
  6. Important owner URLs are present.
  7. Lastmod changes only with meaningful resource changes.
  8. The sitemap index references existing child files within limits.
  9. Robots.txt references the intended sitemap location.
  10. Search Console and log trends are reviewed by segment.

Store failing samples and counts by template. A percentage without URLs cannot be reproduced.

Build a sitemap evidence join

The most useful audit table starts with one row per canonical candidate and joins:

  • sitemap file and lastmod;
  • HTTP status and final URL;
  • robots and X-Robots directives;
  • declared canonical;
  • indexability;
  • crawl depth and internal inlinks;
  • Search Console submitted, crawled, and indexed state;
  • last crawler request from logs;
  • content owner, priority, and acceptance test.

This is what the downloadable Technical SEO Field Kit is designed to capture. The XML file remains simple; the evidence model around it becomes useful.

Questions people actually ask
FAQ · 5
Q01 Does submitting a sitemap guarantee indexing? +
No. It helps discovery and communicates preferred inventory, but search engines still evaluate crawl access, response status, canonical selection, directives, duplication, and content value.
Q02 Should noindex pages be in a sitemap? +
No. The sitemap says the URL is a preferred candidate while noindex says it should not appear. Remove the contradiction and keep the sitemap focused on indexable owners.
Q03 How often should a sitemap update? +
Regenerate it when eligible URLs or meaningful modification dates change. The frequency should follow publishing and inventory changes, not an arbitrary daily timestamp rewrite.
Q04 Do I need separate sitemaps? +
Use multiple sitemaps when limits require it or when segmentation makes diagnosis and ownership clearer, such as products, categories, articles, locales, or release batches.
Q05 Should parameter URLs be in a sitemap? +
Only when a parameterized URL is intentionally canonical, indexable, stable, and valuable. Tracking, sorting, session, and duplicate filter states normally do not belong.
Sources & further reading
  1. [01]
    Build and submit a sitemap
    Google Search Central
    DOC
  2. [02]
    Sitemaps overview
    Google Search Central
    DOC
  3. [03]
    Sitemaps XML format
    Sitemaps.org
    STANDARD
  4. [04]
    How to specify a canonical URL
    Google Search Central
    DOC
Markdown version: index.md
INBOX · TWICE A MONTH
Notes from the lab, in your inbox.

The same pipelines I run for paying clients — written up first for subscribers.

Niko Alho
Niko Alho

I run agentic SEO and build custom AI for B2B companies. Based in Turku.

About