InsightsTechnical SEO

sitemap.xml: what goes in it, what breaks it, and how to tell it's working

A sitemap tells search engines which URLs to crawl. Get it wrong and Google wastes its crawl budget on dead pages or misses your content entirely. Here's what belongs in it, how generated apps break it, and how to verify it.

Aug 8, 2026 · 6 min read

The short version

A sitemap is a list of your indexable URLs in XML format. It's not optional for a new app: without inbound links from established sites, Google has no other way to discover your pages. But a sitemap with stale URLs, missing entries, or URLs that conflict with your canonical tags is worse than no sitemap at all — it wastes Google's crawl budget on dead ends and confuses its indexing.

What belongs in a sitemap

Only indexable, canonical pages. Every URL listed should:

  • Return a 200. A sitemap that lists 404s or redirects wastes crawl budget — Google tries each one, gets bounced, and stops trusting the sitemap.
  • Be the canonical URL. The URL in the sitemap must match the <link rel="canonical"> on the page byte-for-byte, including protocol, host and trailing slash.
  • Not be blocked by robots.txt or a `noindex` meta tag. Listing a blocked page tells Google to index something you told it not to — inconsistent signals get ignored.
  • Be self-contained. Don't list pages that are thin duplicates or parameterized variants (?ref=, ?session=) unless they're genuinely distinct content.

The three lines that make it work

sitemap.xmlxml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yourapp.com</loc>
    <lastmod>2026-08-08</lastmod>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://yourapp.com/pricing</loc>
    <lastmod>2026-08-01</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

Then reference it in robots.txt — this is the discovery chain that lets Google find the sitemap without already knowing it exists:

robots.txttxt
Sitemap: https://yourapp.com/sitemap.xml

How generated apps break it

MistakeWhat happensFix
No sitemap at allGoogle discovers pages by luck from inbound links — a new app has none, so nothing gets indexedGenerate one with your public routes
Lists dev/staging URLsGoogle indexes your staging site and splits ranking signals from productionGenerate from the production URL only
URLs don't match canonicalsGoogle sees competing signals and may index neither versionMake sitemap and canonical identical per page
Stale after a route changeGoogle crawls old pages that now 404, wastes budget, trusts the sitemap lessRegenerate on every deploy that adds or removes routes
Missing from robots.txtGoogle may never find the sitemap unless someone links to it directlyAdd Sitemap: directive to robots.txt

How to verify it's working

  1. 1

    Open it directly

    Load https://yourapp.com/sitemap.xml in a browser. You should see XML with your URLs, not a 404 or a redirect.

  2. 2

    Submit it in Google Search Console

    Under Indexing → Sitemaps, add your sitemap URL. A green "Success" means Google found and read it. A red status tells you exactly what's wrong.

  3. 3

    Check the indexed page count

    In Search Console, under Indexing → Pages, compare the number of indexed pages to the number of URLs in your sitemap. A large gap means many pages are discovered but not indexed — usually because of thin content or a noindex tag.

  4. 4

    Audit the sitemap URLs

    Crawl the sitemap with any URL checker and confirm every entry returns a 200, has a matching canonical, and isn't blocked by robots.txt.

Actuant checks whether your sitemap exists, whether robots.txt references it, and whether the URLs in it match your canonicals — all deterministic, all pass-or-fail.