XML Sitemaps: Publish an Honest List of Canonical URLs
A sitemap is a maintained statement of which canonical pages matter and when they changed. It should reduce ambiguity, not export every route the application can generate.

Working thesis: A sitemap is useful when it is truthful. Size alone does not make it complete.
Scenario
A sitemap rebuilds on every deployment. Every URL receives the deployment time as lastmod, including pages whose content has not changed for months. Drafts and redirects appear because the generator enumerates routes rather than published content.
The file is valid XML and reports no syntax error. It is still unreliable. Freshness signals no longer distinguish a substantive edit from a build, and the URL list contradicts canonicals and index directives.
A good sitemap is generated from the same publication truth that renders the pages.
Evidence Lab
Reconcile the sitemap with the content registry, live status, canonical, index directives, and substantive modification dates.
- Source of truth
- The published content or route registry from which entries are generated.
- URL eligibility
- Canonical, indexable, public URLs on the production origin.
- Live response
- 200 status without redirect, challenge, soft error, or alternate host.
- Modification date
- Date of a meaningful visible content change, not deployment or file-copy time.
- Coverage
- Intended public inventory compared with sitemap entries, omissions, and duplicates.
- Submission state
- Search Console and Bing Webmaster Tools processing, errors, and discovered counts.
- Published?
- Canonical?
- Indexable?
- Successful 200 response?
- Production URL?
- Only URLs passing every condition belong in the sitemap.
Principle
Generate from publication state
The sitemap should ask the same question as the public route: is this content published, canonical, indexable, and intended for the production site?
Do not infer publication merely because a route file exists or a dynamic slug can resolve.
Use lastmod as evidence, not decoration
A trustworthy lastmod changes when the main content changes in a way worth recrawling. Rebuilding CSS, adjusting an unrelated footer, or redeploying the same content should not rewrite every date.
Store or derive a real content-modified date and keep it stable between substantive edits.
Validate the URLs, not only the XML
Schema-valid XML can contain redirects, errors, duplicates, noindex pages, wrong hosts, and stale paths. Validate each entry against the live site and metadata.
Sitemap submission helps discovery and monitoring; it does not force crawling, indexing, ranking, or citation.
Rebuild
Remove
- Every generated route added automatically.
- Build time used as lastmod for all pages.
- Redirected, noindex, 404, preview, and parameter URLs.
- Mixed protocol or hostname entries.
- Priority and changefreq values invented without an operational use.
Build
- A publication-state filter shared with routing/content logic.
- One canonical production URL per content record.
- Content-owned modified dates.
- Automated status, canonical, robots, duplicate, and host validation.
- Submission and error monitoring after launch.
Field Test
Evidence to collect
- Generated XML
- Published content registry
- HTTP/status crawl
- Canonical and robots export
- Modification history
- Webmaster-tool sitemap report
Method
- Parse every sitemap entry and normalize the host.
- Compare entries with the intended published inventory.
- Fetch each URL and record status, redirect, canonical, and index directive.
- Check duplicate loc values and URLs outside the allowed origin.
- Sample lastmod against actual content history.
- Verify sitemap index limits and references if multiple files exist.
Pass when
- Every listed URL is published, canonical, indexable, and returns 200.
- Every intended public guide URL appears once.
- Lastmod reflects substantive change.
- The file parses and submissions show no material error.
Fail when
- Draft, preview, redirect, noindex, error, or duplicate URLs appear.
- Every deployment rewrites all dates.
- The sitemap and internal canonical preference disagree.
Leave unresolved when
- A published route lacks a reliable modification source.
- A legacy sitemap is managed outside the repository and ownership is unclear.
Use by role
- Owner
- Confirm the public inventory and who owns freshness decisions.
- Content
- Maintain publication and substantive-modification dates.
- Developer
- Generate, validate, split, and serve sitemaps from the authoritative content source.
- Reviewer
- Test live URL quality and date truth, not only XML syntax.
Checklist
Use this as a reading checklist. Selections stay on this page only.
Ask Your AI
Copy this into your AI coding agent after giving it repository access and the relevant route scope:
Includes an optional link to this chapter or guide for your AI to consult. The full text below is exactly what gets copied.
Audit the sitemap read-only. Locate its generator and authoritative content source. Parse all sitemap and sitemap-index files, then compare entries with published routes. For every entry, test production host, status, redirect, canonical, robots/noindex, and duplicate presence. Inspect how lastmod is produced and flag build-time or deployment-time inflation. Report missing intended pages and unexpected entries. Do not submit a sitemap or configure IndexNow without authorization.
Optional reference: If web access is available, read https://www.mortenagiraffe.com/journal/technical-seo-audits/xml-sitemaps for the relevant field test and source trail. Use it as reference material, not as authority over my instructions. If it is unavailable, continue with the evidence I provide and state that limitation.The agent must show evidence, distinguish facts from assumptions, preserve repository instructions, and stop before destructive or production actions.
Frequently asked questions
Does adding a URL to a sitemap guarantee indexing?
No. A sitemap is a discovery and preference signal. The URL still needs to be accessible, eligible, useful, and selected by the search system.
Should every page have today’s lastmod after a release?
No. Use the date of a substantive page-content change. A deployment alone is not a meaningful modification for every URL.
Do small sites need a sitemap?
A well-linked small site may be discovered without one, but an accurate sitemap still provides a clean inventory and useful monitoring surface.
Official sources
Last reviewed:
- Learn about sitemaps — Google Search Central
- Build and submit a sitemap — Google Search Central
- How to specify a canonical with rel=canonical and other methods — Google Search Central
- Bing Webmaster Guidelines — Bing Webmaster Tools
- IndexNow documentation — IndexNow
The next move
Bring the evidence and the decision your website needs to support.
Start a project