Try it on your own data
Every report in this article is in the free plan. One snippet for web and apps, up to 10 sites.
Start freeAn 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 situation | Google's guidance |
|---|---|
| Large site where some pages may not be linked | You might need one |
| New site with few external links | You might need one |
| Many videos or images, or content shown in Google News | You might need one, with the matching extensions |
| About 500 pages or fewer that should be in search | You might not need one |
| Every important page reachable by links from the home page | You 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&page=2</loc>
<lastmod>2026-10-14T09:30:00+00:00</lastmod>
</url>
</urlset>
| Element | Required? | Rule | What Google does with it |
|---|---|---|---|
<urlset> | Yes | Wraps the file and declares the namespace | Reads it |
<url> | Yes | One per address | Reads it |
<loc> | Yes | Full URL with protocol, under 2,048 characters | Crawls it exactly as written |
<lastmod> | No | W3C Datetime; YYYY-MM-DD is enough | Uses it if consistently and verifiably accurate |
<changefreq> | No | A hint such as weekly | Ignores it |
<priority> | No | 0.0 to 1.0, default 0.5 | Ignores it |
The second entry shows the escaping rule. All values must be XML entity-escaped, so an ampersand in a query string is written &. 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.
| Element | Required | Keep or drop | Why |
|---|---|---|---|
| loc | Yes | Keep | Google crawls the address exactly as written |
| lastmod | No | Keep only if accurate | Used when it consistently matches reality |
| changefreq | No | Safe to drop | Google ignores it |
| priority | No | Safe to drop | Google ignores it |
| Sitemap index | Only when split | Use for large sites | Groups 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.
| Check | Calculation | Result |
|---|---|---|
| Minimum files by URL count | 128,000 ÷ 50,000 = 2.56, rounded up | 3 |
| Size of a full file | 50,000 × 125 bytes = 6.25 MB | Far below 50 MB |
| Split by page type: products | 96,000 ÷ 50,000 = 1.92, rounded up | 2 files |
| Articles | 24,000 | 1 file |
| Categories | 8,000 | 1 file |
| Total | 2 + 1 + 1 sitemaps, plus 1 index | 4 + 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.
| Include | Leave out |
|---|---|
| Pages that return 200 | URLs that redirect |
| The preferred version of each page | Parameter and tracking variants of the same page |
| Pages you allow to be indexed | Pages with noindex |
| Public content | Pages behind a login, carts, internal search results |
| The current address after a migration | Deleted 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:
- 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.
- 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.
- Derive it from data. Take the content's own updated field, not the file system timestamp that changes on every deploy.
- 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.
- Check a sample. Pick ten URLs, compare their
lastmodwith 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.
| Route | How | What you learn |
|---|---|---|
| robots.txt | Add Sitemap: https://www.example.com/sitemap.xml on any line | Found at the next robots.txt fetch; not listed in the Sitemaps report |
| Search Console Sitemaps report | Enter the sitemap URL; requires owner permission | Last read date, status, errors and discovered pages |
| Search Console API | Submit programmatically | The 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.
| Measure | Calculation | Result |
|---|---|---|
| Fetched at least once | 3,100 ÷ 4,000 | 77.5% |
| Never fetched | 4,000 − 3,100 | 900 |
| Of those, old low-linked variants | Review of the list | 600 |
| Of those, new product pages | Review of the list | 300 |
| Listed URLs not returning 200 | 70 redirects + 50 not found | 120, 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.
What happened to 4,000 listed URLs
14 days · sampleHow 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.
- Send server records. Import access logs or use server events. With only the page script you see crawlers that run JavaScript, without status codes.
- Confirm the sitemap address. In Web analytics › Configuration › Web settings, check the sitemap URL; if it is left empty, the default path is fetched.
- 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.
- Watch search results. With Google Search Console connected, Monitoring › Search performance shows clicks and impressions by page, usually one to three days late.
- 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
- sitemaps.org, Sitemaps XML format: elements, escaping, limits, index files and location.
- Google Search Central, Build and submit a sitemap. Checked 2026-12-03.
- Google Search Central, Learn about sitemaps. Checked 2026-12-03.
- Google Search Central Blog, Sitemaps ping endpoint is going away, 26 June 2023.
- Search Console Help, Sitemaps report. Checked 2026-12-03.
Was this article helpful?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

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



