- An XML sitemap lists the URLs that search engines should crawl and index. Google uses it as a hint and decides for itself what goes into the index.
- Each file holds 50,000 URLs or 50 MB uncompressed. Larger websites split them up and bundle the files in a sitemap index.
- Google reads lastmod if the date is reliably accurate. Google ignores priority and changefreq.
What is an XML sitemap for?
An XML sitemap is a file in which you list the URLs of your website for search engines. The format is described by the protocol on sitemaps.org, which Google, Bing and other search engines support. Google also finds pages via links. The sitemap helps where links alone are not enough.
According to Google, it is worth it above all in three cases. The website is large, it is new and has few external links, or it has many images, videos or news articles. According to the same documentation, a website with around 500 pages or fewer that is well linked internally may not need a sitemap.
For large websites, the sitemap has a second benefit. It is your list of the URLs that should be indexed. If you compare it with the crawl and the Search Console indexing report, you see which pages are missing or surplus.
Structure and limits
A sitemap consists of the urlset element with the protocol's namespace. Inside it there is a url entry for every page, with the address in loc. Everything else is optional. This is what a minimal sitemap looks like.
| Element | Required | What Google does with it |
|---|---|---|
| loc | yes | Crawls the URL exactly as written. It must be absolute, including the protocol. |
| lastmod | no | Uses the date to schedule crawling if it reliably matches the last significant change |
| changefreq | no | Ignored |
| priority | no | Ignored |
Limits per file
| Limit | Value | Source |
|---|---|---|
| URLs per sitemap | 50,000 | sitemaps.org, Google |
| File size | 50 MB uncompressed, gzip is allowed | sitemaps.org, Google |
| Sitemaps per sitemap index | 50,000 | sitemaps.org |
| Index files per website in Search Console | 500 | |
| Length of a URL in loc | under 2,048 characters | sitemaps.org |
| Character set | UTF-8, special characters such as & as entities | sitemaps.org, Google |
A sitemap may only contain URLs from its own directory and below, with the same protocol and host. If you submit it via Search Console, this restriction does not apply at Google. Google still recommends placing sitemaps in the root directory.
Sitemap index for large websites
Once the website grows beyond 50,000 URLs, you split the list across several files. A sitemap index points to these files. A split by page type makes sense, for example products, categories and guides. In Search Console you then see for each sitemap how many pages were discovered.
An index may only point to sitemaps. Search Console does not accept another index inside it.
Extensions for hreflang, images, videos and news
Google supports four extensions. In each case you declare the namespace in the urlset and add the details in the matching url entry. Every extension makes the file bigger, but the limits stay the same.
| Extension | What for | Special feature |
|---|---|---|
| xhtml:link (hreflang) | Language and country variants | Each url entry names all variants, including itself |
| image | Images on the page | Reports image URLs for the respective page |
| video | Videos with title, description, thumbnail | Supplements the details on the page |
| news | Articles for Google News | At most 1,000 articles per sitemap, only articles from the last two days |
The hreflang guide explains how to maintain hreflang cleanly via the sitemap.
Common mistakes
Most problems with sitemaps arise when the CMS or a plugin generates them automatically. They rarely stand out, because the file still loads.
- The sitemap contains URLs with noindex, a canonical to another URL, a redirect or status 404.
- The generator stops at a fixed number. Thousands of pages are then in no sitemap, and nobody notices.
- lastmod shows the generation date for all URLs. Google can then no longer trust the value.
- The sitemap uses http or a different host than the website.
- The sitemap is blocked by robots.txt or returns an error after a release.
- After a relaunch, the old URLs are still in the sitemap.
In large shops, an error often only shows up in a comparison. The number of URLs in the sitemap stays the same for weeks while the product range grows. Looking at the count per file and per page type makes this visible.
Submitting and checking
There are three ways for Google. You enter the sitemap in the Search Console Sitemaps report, you use the Search Console API, or you name it in the robots.txt. The line can be anywhere, and several lines are allowed.
Google deprecated the former ping endpoint in 2023. Pings to this address no longer do anything.
The Search Console Sitemaps report
For each sitemap, the report shows the status, the date it was last read and the number of discovered pages and videos. “Success” means Google has processed the file. With “Has errors”, Google loaded the file but did not read every entry. “Couldn't fetch” points to a problem with the server, robots.txt or URL. “Discovered” does not yet mean “indexed”. Only the “Page indexing” report, filtered to the respective sitemap, shows which URLs are in the index.
Checklist
- Every URL in the sitemap returns status 200, is indexable and canonical.
- Every page that should rank is in a sitemap.
- No file exceeds 50,000 URLs or 50 MB uncompressed.
- lastmod only changes with significant changes to content, structured data or links.
- The robots.txt names the sitemap or the index.
- The number of URLs per sitemap matches the number of pages in the shop or CMS.
- After every release, the sitemap loads without errors.
Frequently asked questions
Do I need an XML sitemap?
Google recommends a sitemap for large or new websites and for many images, videos or news articles. With around 500 pages or fewer and good internal linking, Google says you can do without one.
How do I create an XML sitemap?
Most CMSs and shop systems generate sitemaps themselves or via a plugin. For large websites, a custom export from the database is worth it, one that only outputs indexable URLs and splits them by page type.
How do I find a website's sitemap?
Look in the robots.txt under /robots.txt. There is usually a “Sitemap:” line there. Many websites also place the file under /sitemap.xml or /sitemap_index.xml.
Do priority and changefreq affect rankings?
No. Google ignores both. Other search engines may read them. The protocol only describes them as hints.
How often should I update the sitemap?
Whenever pages are added, removed or change significantly. Ideally the system regenerates the sitemap automatically and only sets lastmod for real changes.
Is the XML sitemap still relevant?
Yes. Google still names it as a way to submit URLs. With lastmod, Google schedules crawls of known URLs if the date is reliable.
Sources
Retrieved on October 15, 2026. If something is out of date or missing, let us know.
- sitemaps.org, Sitemaps XML format: https://www.sitemaps.org/protocol.html · Retrieved Oct 15, 2026
- Google, Build and submit a sitemap: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap · As of Jul 8, 2026
- Google, Sitemaps overview: https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview · As of Dec 10, 2025
- Google, Manage large sitemaps: https://developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps · As of Dec 10, 2025
- Google, Combine sitemap extensions: https://developers.google.com/search/docs/crawling-indexing/sitemaps/combine-sitemap-extensions · As of Dec 10, 2025
- Google, News sitemap: https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap · As of Dec 10, 2025
- Google, Localized versions (hreflang): https://developers.google.com/search/docs/specialty/international/localized-versions · As of Sep 21, 2026
- Search Console Help, Sitemaps report: https://support.google.com/webmasters/answer/7451001 · Retrieved Oct 15, 2026
- Google Search Central Blog, Sitemaps ping endpoint is going away: https://developers.google.com/search/blog/2023/06/sitemaps-lastmod-ping · Jun 26, 2023