Guides

XML sitemap best practices

XML sitemap best practices from Google's documentation: size limits, sitemap index files, which URLs to include, how Google uses lastmod, and how to submit.

An XML sitemap is a list of the URLs you want search engines to know about. It doesn't force anything — Google describes submitting a sitemap as a hint, not a guarantee — but an accurate sitemap helps crawlers find new and updated pages and tells them which URLs you consider canonical. Here's what Google's documentation says matters.

Do you need one?

Google notes that small sites (roughly 500 pages or fewer that you want in search results) whose pages are all well linked internally may not need a sitemap. They tend to help most on large sites, new sites with few external links, and sites with lots of rich media or news content. That said, a correct sitemap rarely hurts and is cheap to maintain when your platform generates it automatically.

Size limits

A minimal sitemap index looks like this:

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

Splitting by section (products, articles, categories) also makes the Search Console Sitemaps report more useful, because you can see indexing problems per section.

Format and location

Which URLs belong in a sitemap

Include the URLs you want to appear in search results — your canonical URLs. In practice that means every URL in the sitemap should:

Listing redirected, blocked or noindexed URLs sends mixed signals and makes the Sitemaps report harder to read. If you have separate mobile URLs, Google recommends listing one version (or annotating both).

lastmod: useful only if honest

Google ignores <priority> and <changefreq>. It does use <lastmod>, but only when it is consistently and verifiably accurate. The date should reflect the last significant change to the page — main content, structured data or links — not a copyright year or a sidebar widget.

Common mistakes:

If Google learns your lastmod values are unreliable, it may stop using them, which removes one of the best signals you have for getting updated pages recrawled. Google's crawl budget guidance specifically recommends keeping sitemaps up to date and using lastmod for updated content.

How to submit

Google has retired its old sitemap "ping" endpoint, so rely on the methods above and accurate lastmod values instead.

Sitemaps and crawl diagnostics

Your sitemap is also a statement of intent. Comparing it with what Google actually crawls is one of the fastest ways to find problems:

Quick checklist

  1. Under 50,000 URLs and 50 MB uncompressed per file; index file for more.
  2. UTF-8, absolute URLs, properly escaped.
  3. Only canonical, indexable, 200-status URLs that aren't blocked.
  4. Accurate lastmod; no reliance on priority or changefreq.
  5. Referenced in robots.txt and submitted in Search Console.
  6. Generated automatically so it stays in sync with the site.

To see how many URLs your sitemaps expose and how fresh their lastmod dates look, run your domain through the free Crawl Budget Snapshot.

Check your own site

The free Crawl Budget Snapshot fetches a site's public robots.txt and sitemaps and gives a quick crawl-waste score with suggested fixes. It is a starting point, not a replacement for Search Console or log analysis.

References

More guides