TapCub is live — analytics, insights and live chat, free on one platform
Analytics

XML sitemap: format rules and limits and how to check uptake

What an XML sitemap is, a valid example, the 50,000 URL and 50 MB limits, which URLs belong, how to set lastmod, how to submit it and how to measure whether crawlers use it.

Lin Zhou Published Dec 3, 2026 12 min read Analytics
Sample data: 900 of 4,000 URLs were not fetched. The 300 new products and the 120 non-200 entries are the ones to act on; the non-200 count overlaps the other groups.Sample data

An XML sitemap is a file listing the URLs you want search engines to know about, with an optional last-modified date for each. One file holds up to 50,000 URLs and 50 MB uncompressed. It is a hint, so list only canonical pages that return 200, keep lastmod honest and check your logs for what gets fetched.

What you will learn

  • One file holds at most 50,000 URLs and 50 MB uncompressed; split larger sites and group files in a sitemap index
  • Google ignores priority and changefreq and uses lastmod only when it is consistently and verifiably accurate
  • A Success status only means the file was read; join the sitemap to server logs to see which URLs were fetched

What is an XML sitemap?

An XML sitemap is a file that lists the URLs on your site that you want search engines to know about, in a format defined by the Sitemaps protocol. Each entry gives an address and, optionally, the date it last changed. Search engines read the file to discover pages and to decide what is worth fetching again.

It is a list of suggestions. Google's documentation says that submitting a sitemap is only a hint: it does not guarantee the file will be downloaded or that the URLs will be crawled, and listing a URL does not guarantee indexing. The reverse also holds. Leaving a URL out does not stop Google from crawling or indexing it if it finds a link to it, so a sitemap is not a way to hide pages.

An XML sitemap is also not an HTML sitemap. The latter is an ordinary page of links for visitors; Google notes it is not a format you can submit in Search Console.

Do you need an XML sitemap?

Google's introduction gives a fairly clear test. If your pages are properly linked, it can usually discover most of a site, yet most sites still benefit from having a sitemap.

Your situationGoogle's guidance
Large site where some pages may not be linkedYou might need one
New site with few external linksYou might need one
Many videos or images, or content shown in Google NewsYou might need one, with the matching extensions
About 500 pages or fewer that should be in searchYou might not need one
Every important page reachable by links from the home pageYou might not need one

If a CMS already produces a sitemap, the question is not whether to have one but whether it is accurate. Most of this article is about that.

What does a valid XML sitemap look like?

A minimal file with two pages:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/</loc>
    <lastmod>2026-11-30</lastmod>
  </url>
  <url>
    <loc>https://www.example.com/search?q=boots&amp;page=2</loc>
    <lastmod>2026-10-14T09:30:00+00:00</lastmod>
  </url>
</urlset>
ElementRequired?RuleWhat Google does with it
<urlset>YesWraps the file and declares the namespaceReads it
<url>YesOne per addressReads it
<loc>YesFull URL with protocol, under 2,048 charactersCrawls it exactly as written
<lastmod>NoW3C Datetime; YYYY-MM-DD is enoughUses it if consistently and verifiably accurate
<changefreq>NoA hint such as weeklyIgnores it
<priority>No0.0 to 1.0, default 0.5Ignores it

The second entry shows the escaping rule. All values must be XML entity-escaped, so an ampersand in a query string is written &amp;. The file must be UTF-8.

Use fully qualified, absolute URLs. A relative path such as /mypage.html is wrong, and the addresses should match the version of the site you actually serve, including https and www.

ElementRequiredKeep or dropWhy
locYesKeepGoogle crawls the address exactly as written
lastmodNoKeep only if accurateUsed when it consistently matches reality
changefreqNoSafe to dropGoogle ignores it
priorityNoSafe to dropGoogle ignores it
Sitemap indexOnly when splitUse for large sitesGroups up to 50,000 sitemap files

Based on the sitemaps.org protocol and Google's sitemap documentation, checked 2026-12-03.

What are the size and location limits?

One sitemap file may hold at most 50,000 URLs and be at most 50 MB (52,428,800 bytes) uncompressed. Gzip saves bandwidth, but the limit applies to the uncompressed file. Beyond either limit, split into several files and, optionally, list them in a sitemap index:

<?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-11-30</lastmod>
  </sitemap>
</sitemapindex>

An index may list up to 50,000 sitemaps and has the same 50 MB limit. Its lastmod describes when the sitemap file changed, not when any page in it changed.

Location matters too. Unless you submit it through Search Console, a sitemap affects only URLs under the directory that holds it, so a file in /catalog/ cannot speak for /blog/. Placing it at the site root avoids the question. Under the protocol, the URLs in one sitemap must also use the same protocol and host as the sitemap, with separate cross-submission methods for several sites.

Worked example: splitting a 128,000-URL site

Sample data: a shop has 96,000 product URLs, 24,000 articles and 8,000 category pages, 128,000 in all. An entry with a loc of about 60 characters and a lastmod takes about 125 bytes.

CheckCalculationResult
Minimum files by URL count128,000 ÷ 50,000 = 2.56, rounded up3
Size of a full file50,000 × 125 bytes = 6.25 MBFar below 50 MB
Split by page type: products96,000 ÷ 50,000 = 1.92, rounded up2 files
Articles24,0001 file
Categories8,0001 file
Total2 + 1 + 1 sitemaps, plus 1 index4 + 1

The URL limit binds long before the size limit does. Splitting by type costs one file more than the minimum of three and pays it back in diagnosis: Google says you can submit several sitemaps and index files, which is useful for tracking each one's performance in Search Console. If product pages are not being indexed, you will see it in their own files.

Which URLs belong in a sitemap?

Google's rule is short: include the URLs you want to see in search results, which should be the canonical ones.

IncludeLeave out
Pages that return 200URLs that redirect
The preferred version of each pageParameter and tracking variants of the same page
Pages you allow to be indexedPages with noindex
Public contentPages behind a login, carts, internal search results
The current address after a migrationDeleted pages returning 404 or 410

Mixed signals are the main risk. A sitemap that names one URL while the page's canonical names another gives search engines two answers. For what stops a page from being indexed in the first place, see indexability. For language versions, the sitemap can also carry alternate-language annotations; multilingual SEO covers the rules.

A quick quality test: fetch every URL in the file and count anything that is not a 200. How to check URL status codes describes how to run that and rank the failures. Fix the generator, not the file, or the next build puts the bad URLs back.

How should lastmod be set?

lastmod is the one optional element worth getting right. Google uses it when it is consistently and verifiably accurate, for instance when it matches what the page itself shows. In 2023 Google described it as a signal for scheduling crawls of URLs it already knows, and warned that a site whose dates do not match reality will eventually not be believed.

Rules that keep it trustworthy:

  1. Use the date of the last significant change. Changes to the main content, structured data or links count. Updating a copyright year or a sidebar widget does not.
  2. Never stamp every URL with the build time. The protocol says the date is when the page was modified, not when the sitemap was generated.
  3. Derive it from data. Take the content's own updated field, not the file system timestamp that changes on every deploy.
  4. Leave it out where you do not know. Google said it is fine to omit it for pages such as a home page that only aggregates others.
  5. Check a sample. Pick ten URLs, compare their lastmod with the visible update dates and your change history.

A simple smell test: if all 128,000 entries in the example carried today's date, the element would carry no information at all.

How do you submit a sitemap?

There are three ordinary routes for Google.

RouteHowWhat you learn
robots.txtAdd Sitemap: https://www.example.com/sitemap.xml on any lineFound at the next robots.txt fetch; not listed in the Sitemaps report
Search Console Sitemaps reportEnter the sitemap URL; requires owner permissionLast read date, status, errors and discovered pages
Search Console APISubmit programmaticallyThe same information, scriptable

The old "ping" URL is not one of them. Google announced in June 2023 that it was deprecating the sitemaps ping endpoint and that requests to it would return 404, so remove it from deployment scripts.

"Submitting" only tells Google where the file is. The file has to be reachable by Googlebot, not blocked by robots.txt and not behind a login. The Sitemaps report also states that deleting a sitemap there does not make Google forget the URLs.

How do you check whether crawlers use your sitemap?

A "Success" status means the file was read, not that its pages were visited. Measure uptake by joining the sitemap to your server logs.

Sample data: a sitemap lists 4,000 URLs. Over the 14 days after submission, logs show a verified Googlebot fetching 3,100 of them.

MeasureCalculationResult
Fetched at least once3,100 ÷ 4,00077.5%
Never fetched4,000 − 3,100900
Of those, old low-linked variantsReview of the list600
Of those, new product pagesReview of the list300
Listed URLs not returning 20070 redirects + 50 not found120, or 3.0% of the file

The percentage alone is not the finding. The 600 old variants probably should not be listed; the 300 new products are the real problem and usually need internal links as well as a sitemap entry. The 120 non-200 URLs are a defect in the generator. After cleaning, measure the same window again.

For the method on logs, see log file analysis for SEO. If the pattern is that crawlers fetch the wrong things, crawl budget explains when that matters, and crawl errors what the failures mean.

app.tapcub.com

What happened to 4,000 listed URLs

14 days · sample
Fetched by a verified Googlebot3,100 · 77.5%
Never fetched: old low-linked variants600 · 15.0%
Never fetched: new product pages300 · 7.5%
Listed but not returning 200120 · 3.0%
Sample data
Sample data: 900 of 4,000 URLs were not fetched. The 300 new products and the 120 non-200 entries are the ones to act on; the non-200 count overlaps the other groups.

How to check sitemap uptake in TapCub

Take the 4,000-URL sitemap. TapCub does not generate or submit sitemaps; it compares what you list with what crawlers actually fetched.

  1. Send server records. Import access logs or use server events. With only the page script you see crawlers that run JavaScript, without status codes.
  2. Confirm the sitemap address. In Web analytics › Configuration › Web settings, check the sitemap URL; if it is left empty, the default path is fetched.
  3. Read the gap. Monitoring › Crawl health then lists sitemap URLs that no engine has fetched, and shows how long pages that first appeared in the last 30 days waited for each engine's first fetch. Open an engine row to see the pages it fetches most. Check crawl health walks through the setup.
  4. Watch search results. With Google Search Console connected, Monitoring › Search performance shows clicks and impressions by page, usually one to three days late.
  5. Turn on the alert. The Crawl anomaly notification fires when one search engine's fetches in 24 hours fall below 30% of its 7-day daily average, for engines averaging at least 20 fetches a day.

FAQ

What is an XML sitemap used for?

It tells search engines which URLs you want them to know about and, optionally, when each last changed significantly. That helps discovery on large, new or weakly linked sites. It does not force crawling or indexing, and it does not replace internal links, which remain the main way pages are found.

Where is the XML sitemap of a website?

Commonly at /sitemap.xml or /sitemap_index.xml on the root, though the name and place are free. The reliable places to look are the Sitemap: lines in /robots.txt and, for your own site, the Sitemaps report in Search Console or your CMS settings.

Is there a limit on URLs in a sitemap?

Yes. One file may list up to 50,000 URLs and be up to 50 MB uncompressed. Larger sites split the list into several files and can group them in a sitemap index, which may itself reference up to 50,000 sitemaps.

Does Google use priority and changefreq?

No. Google's documentation says it ignores both values. They remain valid in the protocol and other consumers may read them, but they will not change how Google crawls your site. An accurate lastmod is the optional field that Google does use.

How often should a sitemap be updated?

Whenever the list of URLs or their significant content changes, ideally automatically from your database or build. Google recrawls submitted sitemaps on its own schedule, so you do not need to resubmit after every edit. Resubmit after large structural changes such as a migration.

Sources

Filed underAnalytics

Was this article helpful?

We use your answers to fix and expand this page.

Lin Zhou

Product Experience Specialist

Writes about product experience, practical workflows, and growth, turning complex processes into clear steps for everyday decisions.

See which sitemap URLs were never fetched

Crawl health compares your sitemap with real crawler fetches from server records and shows how long new pages waited.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics