XML Sitemap Guide

A practical sitemap.xml audit: which URLs belong, how canonical, robots and lastmod should align, and why the file cannot guarantee indexing.

What sitemap.xml does—and what it does not

A sitemap gives search engines a list of URLs the site owner considers important. It supports discovery and reinforces preferred canonical addresses, but it is not an instruction to add every submitted page to the index.

If a URL returns an error, carries noindex, points its canonical elsewhere or barely differs from many neighbouring pages, sitemap inclusion does not repair it. Improve the page first and list it only when the technical and editorial signals agree.

URL validation diagram before inclusion in sitemap.xml
A sitemap does not repair a page; it confirms already aligned signals for a preferred canonical URL.

Five checks before adding a URL

Apply a short eligibility filter before generating the file. The URL should return 200 without a redirect chain, allow indexing, use a self-canonical and have at least one meaningful internal path from navigation or related content.

The final check is editorial: the page needs standalone value. When only a city or service label changes, strengthening one principal page is usually better than submitting a series of nearly identical URLs.

  • Final HTTP status is 200.
  • No meta or X-Robots-Tag noindex.
  • Canonical points to the same accessible URL.
  • A contextual internal link exists.
  • The material answers a distinct visitor need.

The minimum useful XML structure

For a normal HTML page, an absolute address in loc is sufficient. Use lastmod only when it comes from a meaningful update to primary copy, structure, data or important links.

UA/EN pages can include reciprocal hreflang annotations. They must connect true language equivalents rather than point every version to one homepage. priority and changefreq are not a way to make a weak page important.

ElementPractical rule
locAbsolute HTTPS canonical URL
lastmodDate of the latest meaningful update
hreflangReciprocal language equivalents
priority/changefreqNot a substitute for quality

How to validate a sitemap automatically

Parse every loc and fetch the final HTTP status, robots directive and canonical. Then compare the set with the pages that are actually indexable in the built site.

Also find orphan-like URLs and internal links that pass through a 301. A page discoverable only through the sitemap points to an information-architecture problem, not a reason to keep it listed.

  1. Fetch sitemap.xml from production.
  2. Check every loc without hiding redirects.
  3. Compare canonical, robots and HTTP status.
  4. Match the set against an internal crawl.
  5. Repeat the check after deployment.

What to review after Search Console submission

A successful read status is only the beginning. Compare submitted URL counts, exclusion reasons and samples that Google selected or declined to index.

Diagnose an individual page with URL Inspection. If Google sees noindex, cannot load a resource or selects a different canonical, fix the site. Resubmitting an unchanged sitemap does not remove the cause.

How Montana WebStudio applies the rule

The Montana WebStudio sitemap is generated from actual HTML indexability. Pages with noindex, redirects or canonical conflicts are excluded, while UA/EN equivalents receive reciprocal language annotations.

After content changes, the file is checked together with robots.txt, canonicals and internal links. A page can leave the sitemap while it is being improved without deleting its URL from the website.

Quick answers

Frequently asked questions

Does a sitemap guarantee indexing?

No. It supports discovery and preferred URL signals, while Google separately evaluates access, canonicalisation, quality and standalone value.

Should noindex pages appear in a sitemap?

No. That creates conflicting signals: the sitemap proposes the URL for search while the page excludes itself.

When should lastmod change?

After a meaningful update to the primary content, structure or important data. A footer-year change is not enough.

Official sources and tools