Machine-Readable Infrastructure

XML Sitemap

Last reviewed:

Place at the root of your domain, typically /sitemap.xml, and reference it in robots.txt with a Sitemap: directive. Sites with more than 50,000 URLs or multiple content types should use a sitemap index instead.

Sitemap template

The only field search engines act on in practice is lastmod. The legacy priority and changefreq fields are ignored — don’t include them just because old examples on the web still do.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

  <!-- REQUIRED: one <url> block per canonical URL -->
  <url>
    <!-- REQUIRED: canonical URL, no session IDs or tracking parameters -->
    <loc>https://example.com/</loc>
    <!-- RECOMMENDED: date of last substantive content change, ISO 8601 -->
    <lastmod>2026-03-28</lastmod>
  </url>

  <url>
    <loc>https://example.com/about/</loc>
    <lastmod>2026-01-15</lastmod>
  </url>

  <url>
    <loc>https://example.com/products/</loc>
    <lastmod>2026-03-01</lastmod>
  </url>

</urlset>

Field notes

  • 50,000 URL limit per sitemap file and 50MB uncompressed — use a sitemap index for larger sites.
  • lastmod should reflect actual content changes — static or always-today dates train crawlers to ignore it.
  • priority and changefreq are legacy fields search engines ignore in practice — omit them.
  • Don’t include noindex pages, canonicalized pages, redirects, or error pages in the sitemap.
  • Remove query-string variants, session URLs, faceted-navigation duplicates, and paginated pages unless explicitly needed.
  • Submit to Google via Search Console and to Bing via Bing Webmaster Tools — they maintain independent crawl queues.