Sitemap Protocol: What Crawlers Actually Trust

Cover for “Sitemap Protocol: What Crawlers Actually Trust”: sitemap XML fields Google uses or ignores, file limits and a sitemap index

4 min read

A sitemap is a site telling crawlers which URLs it wants found, and roughly when they changed. The protocol behind it, published at sitemaps.org, is small. What matters in practice is which parts of it crawlers believe. Google has said plainly that it ignores two of the four per-URL fields, and uses a third only when it proves accurate.

Key takeaways

  • One sitemap file holds at most 50,000 URLs and 50 MB uncompressed. Larger sites use a sitemap index, which can list up to 50,000 sitemaps.
  • Each URL entry has loc (required) and optional lastmod, changefreq and priority.
  • Google says it ignores priority and changefreq, and uses lastmod only if it is consistently and verifiably accurate.
  • A sitemap lists what a site wants crawled. It is not a complete or current inventory, so treat it as a seed, not as truth.

What the protocol defines

The sitemaps.org protocol describes an XML file with a <urlset> root and one <url> element per page. The file must be UTF-8, and characters such as & must be escaped. Per URL there are four fields:

FieldRequired?FormatWhat Google says it does with it
locYesAbsolute URL, under 2,048 charactersUses it: this is the URL
lastmodNoW3C Datetime, e.g. 2026-10-30 or a full timestampUses it if consistently and verifiably accurate
changefreqNoalways, hourly, daily, weekly, monthly, yearly, neverIgnores it
priorityNo0.0 to 1.0, default 0.5Ignores it

Field definitions from sitemaps.org; Google’s treatment from its build a sitemap documentation, checked October 2026.

The protocol also sets limits: 50,000 URLs and 50 MB (52,428,800 bytes) per file, uncompressed. Files may be gzipped, but the limit applies to the uncompressed size. Anything bigger is split, and the parts are listed in a sitemap index.

How a large site splits its sitemap

An index file points to child sitemaps; robots.txt points to the index

robots.txtSitemap: linesitemap_index.xmlup to 50,000 sitemapsproducts-1.xmlup to 50,000 URLsproducts-2.xmlup to 50,000 URLscategories.xmlup to 50,000 URLsstores.xmlup to 50,000 URLs<url> entries: loc, lastmod, changefreq, priorityEach file: 50 MB max, uncompressed
Limits from the sitemaps.org protocol. File names are illustrative. Graphic: JsonEngine.

There is a location rule that is easy to miss. A sitemap at /catalog/sitemap.xml may only list URLs that start with /catalog/, on the same host. A sitemap referenced from a site’s robots.txt with a Sitemap: line is the exception that lets a site host sitemaps elsewhere and still have them accepted.

What crawlers actually trust

priority and changefreq: ignored by Google

Google’s documentation states that it ignores priority and changefreq. The reason is easy to guess: when every page claims priority 1.0 and daily changes, the fields stop carrying information. For anyone reading sitemaps to plan collection, the lesson is the same. A product page marked changefreq: daily may not have changed in months.

lastmod: used, conditionally

lastmod is the field that matters. Google uses it when it is “consistently and verifiably” accurate, meaning the date matches when the page’s main content actually changed. A site that stamps every URL with today’s date on each build teaches crawlers to ignore its lastmod entirely. Google explained this in a June 2023 Search Central post, the same one that announced the end of the old sitemap “ping” endpoint.

The sitemap itself: a hint, not an inventory

A sitemap lists the URLs a site wants crawled. It often omits pages that exist, such as out-of-stock products, variants or regional pages, and it can keep listing pages that now redirect or return 404. On large catalogs, sitemaps are usually generated by a scheduled job, so they lag behind the live site by hours or days.

How big sitemaps get

Sitemap files needed as a catalog grows

Minimum number of 50,000-URL sitemap files, log scale; one index can list up to 50,000 of them

1101001,00010 thousand URLs1 file100 thousand URLs2 files1 million URLs20 files10 million URLs200 files100 million URLs2,000 files
Calculation: catalog URLs divided by 50,000, rounded up. Graphic: JsonEngine.
Data behind the chart
Catalog URLsSitemap files
10 thousand1
100 thousand2
1 million20
10 million200
100 million2,000

A catalog of a few thousand products fits in one file. A marketplace with tens of millions of listings needs hundreds or thousands, which is why large retailers split sitemaps by type (products, categories, stores) and often by ID range. The split itself is informative: the number and names of child sitemaps tell you roughly how a site’s catalog is organized before you request a single product page.

Reading a sitemap carefully

The code below streams a sitemap or sitemap index without loading it all into memory, handles gzip, and yields each URL with its lastmod. It ignores priority and changefreq, for the reasons above.

Python
import gzip, io
import xml.etree.ElementTree as ET
import requests

NS = "{http://www.sitemaps.org/schemas/sitemap/0.9}"
HEADERS = {"User-Agent": "ExampleCollector/1.0 (+https://example.com/bot; data@example.com)"}

def entries(url, session=None, depth=0):
    """Yield (loc, lastmod) from a sitemap or a sitemap index."""
    s = session or requests.Session()
    r = s.get(url, headers=HEADERS, timeout=(5, 60))
    r.raise_for_status()
    body = r.content
    if body[:2] == b"\x1f\x8b":                  # gzip magic bytes
        body = gzip.decompress(body)
    for _, el in ET.iterparse(io.BytesIO(body)):
        if el.tag == NS + "sitemap" and depth < 2:   # index entry: recurse
            child = el.findtext(NS + "loc")
            if child:
                yield from entries(child.strip(), s, depth + 1)
            el.clear()
        elif el.tag == NS + "url":
            yield el.findtext(NS + "loc", "").strip(), el.findtext(NS + "lastmod")
            el.clear()

Use the standard library parser only on sitemaps from sites you trust to send well-formed XML; Python’s documentation recommends the defusedxml package for untrusted input.

Checking whether lastmod can be trusted

Before using lastmod to skip unchanged pages, test it on a sample. Fetch 100 to 200 URLs, record a hash of the fields you care about (price, availability, title), and refetch them a few days later. Then compare: did the pages whose lastmod moved actually change, and did the pages whose lastmod stayed put actually stay the same? If both hold, lastmod can drive your recrawl schedule. If not, fall back to your own change-rate estimates. We use the same approach for assortment tracking, where a missed change means a missed new product.

A sitemap is not permission

Listing a URL in a sitemap invites search engines to crawl it. It does not change the site’s robots.txt rules or its terms. Check both before collecting from URLs you found in a sitemap.

Quick answers

How many URLs can a sitemap contain?

Up to 50,000 URLs, and no more than 50 MB uncompressed. Larger sites split their URLs across several sitemaps and list them in a sitemap index, which can reference up to 50,000 sitemaps.

Does Google use sitemap priority?

No. Google’s documentation says it ignores the priority and changefreq values in sitemaps.

Does Google use lastmod?

Yes, but only when it is consistently and verifiably accurate, meaning it reflects real changes to the page’s main content.

Is a sitemap a complete list of a site’s pages?

Usually not. It lists the URLs a site wants crawled. Out-of-stock products, variants and regional pages are often missing, and removed pages can linger until the sitemap is regenerated.

Where do I find a site’s sitemap?

Look for Sitemap: lines in the site’s robots.txt first. If there are none, /sitemap.xml and /sitemap_index.xml at the site root are common locations.

Need a full catalog, not just what the sitemap lists?

We combine sitemaps with category coverage checks so delisted and unlisted products don’t slip through. See custom datasets or browse ready datasets.