An XML sitemap is a list, in a strict machine-readable format, of every page on your site you want search engines to know about. It doesn't force Google to crawl or rank anything — that's a common misconception — but it does make discovery dramatically more efficient, which matters more than most sites realize once they get past a few dozen pages.

What a sitemap actually does

Google can, in principle, discover your pages by following links from page to page, starting wherever it already knows about you. A sitemap short-circuits that process: instead of hoping Googlebot eventually finds a product page twelve clicks deep in your catalogue, you hand it the full list directly, along with (optionally) when each page was last modified. For a small site this barely matters. For an e-commerce catalogue, a large content archive, or any site that's recently restructured its URLs, it's the difference between new or changed pages getting noticed in hours versus weeks.

The two formats: urlset and sitemapindex

A standard sitemap uses the <urlset> root element, with one <url> block per page:

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

<loc> is the full, absolute URL — relative paths aren't valid. <lastmod> is optional but genuinely useful: it tells crawlers when to bother re-checking a page, in either a plain date (2026-07-20) or a full ISO 8601 timestamp with time and timezone (2026-07-20T14:32:00Z).

Once a site exceeds the spec's limits — 50,000 URLs or 50MB uncompressed per file — it needs a sitemap index instead: a file that doesn't list pages directly but points to several child sitemaps.

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

Most CMS platforms (WordPress, Shopify, and this site included) generate and chunk this automatically once your content crosses the threshold, so hand-splitting is rarely something you need to do yourself.

Mistakes that quietly undermine it

  • ◆Listing non-canonical or redirected URLs. If a sitemap entry 301-redirects somewhere else, or isn't the canonical version of a page, it sends a mixed signal and wastes crawl budget that could go toward pages you actually want indexed.
  • ◆A lastmod that never changes, or changes on every single page simultaneously. Both patterns tell crawlers the date is meaningless rather than genuinely reflecting content changes, which defeats its purpose as a recrawl signal.
  • ◆Forgetting to update it after a migration or restructure. A sitemap still listing your old URL structure after a platform migration actively points crawlers at dead ends during the exact period you most need clean signals.
  • ◆No sitemap reference in robots.txt. Adding Sitemap: https://example.com/sitemap.xml to your robots.txt (it can live outside any User-agent group) is the standard way crawlers that haven't had it submitted directly still discover it.
  • ◆Including pages blocked by robots.txt or marked noindex. This is directly contradictory — you're telling crawlers "here's an important page" and "don't look at this page" at the same time. Keep the two systems in sync.

Tip If you've recently migrated platforms or restructured URLs, check your sitemap against your actual live redirects, not just against what the CMS auto-generated. A sitemap that was correct the day of launch can quietly drift out of sync with reality as pages get renamed or removed months later.

Checking yours

A sitemap can look structurally fine and still be wrong in ways that are hard to catch by eye — an invalid timestamp format, a handful of non-canonical URLs mixed in, a file that's quietly grown past the entry limit. Our free sitemap validator checks format, size, entry count and every lastmod date against spec, and flags exactly which entries are malformed rather than just giving a pass/fail.

A sitemap only helps if the pages in it are actually worth indexing — see our indexability checker for confirming individual pages are actually eligible, and our guide on why pages don't show up in Google for the broader indexing picture. For a full technical SEO audit covering sitemaps, crawl access and indexing together, our web development services include exactly this kind of review.