Technical

XML Sitemaps: What to Include, What to Leave Out, How to Check

Gold architectural plan of a city-like website on dark paper
A sitemap is a map, not a ranking lever. Draw only the rooms you want visitors in.

An XML sitemap is a list. Google has said for years it does not guarantee indexing. What it does is remove guesswork: here are the URLs we consider canonical and public.

What a useful XML sitemap contains <urlset> <url> <loc>https://example.com/pricing</loc> <lastmod>2026-08-26</lastmod> </url> </urlset>
One loc per URL you actually want indexed. lastmod only if it is true. No thank-you pages, no filtered faceted URLs, no staging hosts.

What belongs

  • Canonical, indexable URLs only — the ones you would be happy to see as a blue link.
  • A real lastmod when the content changed. Fake yesterday’s date on everything and the signal becomes noise.
  • A Sitemap: line in robots.txt pointing at the file. Then submit the same URL in Search Console.

What does not

  • noindexed URLs, thank-you pages, account pages, cart and checkout.
  • Redirects. List the destination, not the hop.
  • Parameter copies (?color=navy) when the canonical is the clean URL.
  • Images and videos unless you are deliberately running image/video sitemaps. Do not dump every media file into the page sitemap.

How it goes wrong in CMS land

Yoast and Rank Math will generate a sitemap that includes every custom post type you forgot to exclude. WooCommerce will add attribute archives. One extra tick in a plugin and you have published 8,000 near-duplicate URLs. Open /sitemap_index.xml, count the children, and delete the types that should never rank.

Check it

The sitemap checker looks for a file at the usual paths and in robots.txt. It will not parse 50,000 URLs — that is Search Console’s job — but it will tell you if the door is missing. Pair it with the full audit so you are not sitemapping a noindexed site.

Frequently asked

Do I need a sitemap if my site has 12 pages?

Yes, still. It is one file, it costs nothing, and it is how you declare the list in robots.txt and Search Console. Small sites benefit from clarity, not from scale.

Should every URL in the sitemap return 200?

Yes. 404s, redirects, and noindexed URLs in a sitemap waste crawl time and train Google to distrust the file.

Keep reading