Technical SEO

Structure, limits and common mistakes of XML sitemaps

How to split sitemaps for large websites, what Google reads and how to find errors early.

index.xmlproductscategoriesguides
Michael WeberLast updated: October 15, 20268 min read
In short
  • 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.

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://www.example.com/gartenmoebel/tische/</loc> <lastmod>2026-10-12</lastmod> </url> <url> <loc>https://www.example.com/gartenmoebel/tische/teak-120/</loc> <lastmod>2026-10-14</lastmod> </url> </urlset>
ElementRequiredWhat Google does with it
locyesCrawls the URL exactly as written. It must be absolute, including the protocol.
lastmodnoUses the date to schedule crawling if it reliably matches the last significant change
changefreqnoIgnored
prioritynoIgnored

Limits per file

LimitValueSource
URLs per sitemap50,000sitemaps.org, Google
File size50 MB uncompressed, gzip is allowedsitemaps.org, Google
Sitemaps per sitemap index50,000sitemaps.org
Index files per website in Search Console500Google
Length of a URL in locunder 2,048 characterssitemaps.org
Character setUTF-8, special characters such as & as entitiessitemaps.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.

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

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.

ExtensionWhat forSpecial feature
xhtml:link (hreflang)Language and country variantsEach url entry names all variants, including itself
imageImages on the pageReports image URLs for the respective page
videoVideos with title, description, thumbnailSupplements the details on the page
newsArticles for Google NewsAt 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.
From practice

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.

# robots.txt User-agent: * Disallow: /warenkorb/ Sitemap: https://www.example.com/sitemaps/index.xml

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

  1. Every URL in the sitemap returns status 200, is indexable and canonical.
  2. Every page that should rank is in a sitemap.
  3. No file exceeds 50,000 URLs or 50 MB uncompressed.
  4. lastmod only changes with significant changes to content, structured data or links.
  5. The robots.txt names the sitemap or the index.
  6. The number of URLs per sitemap matches the number of pages in the shop or CMS.
  7. 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.

searchVIU detects the sitemaps of your domain automatically and checks them daily. If a sitemap returns an error or many URLs disappear, you get an alert by email, Slack, Teams or webhook. Find out more on the XML Sitemap Monitoring page.

Request a demo

Sources

Retrieved on October 15, 2026. If something is out of date or missing, let us know.

  1. sitemaps.org, Sitemaps XML format: https://www.sitemaps.org/protocol.html · Retrieved Oct 15, 2026
  2. Google, Build and submit a sitemap: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap · As of Jul 8, 2026
  3. Google, Sitemaps overview: https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview · As of Dec 10, 2025
  4. Google, Manage large sitemaps: https://developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps · As of Dec 10, 2025
  5. Google, Combine sitemap extensions: https://developers.google.com/search/docs/crawling-indexing/sitemaps/combine-sitemap-extensions · As of Dec 10, 2025
  6. Google, News sitemap: https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap · As of Dec 10, 2025
  7. Google, Localized versions (hreflang): https://developers.google.com/search/docs/specialty/international/localized-versions · As of Sep 21, 2026
  8. Search Console Help, Sitemaps report: https://support.google.com/webmasters/answer/7451001 · Retrieved Oct 15, 2026
  9. Google Search Central Blog, Sitemaps ping endpoint is going away: https://developers.google.com/search/blog/2023/06/sitemaps-lastmod-ping · Jun 26, 2023