What is an XML sitemap? Definition, limits and best practices

An XML sitemap is a file that lists the URLs of a website you want search engines to find, crawl and index, with optional details such as the last modification date. Google, Yahoo and Microsoft agreed on the shared Sitemaps 0.90 protocol on 16 November 2006. One sitemap file can hold up to 50,000 URLs or 50 MB uncompressed, and larger sites split their URLs across several files grouped in a sitemap index.

Updated: 17 October 20263 min read
Infographic: structure of an XML sitemap from robots.txt and sitemap index down to url entries and hreflang links
Source: Google Search Central, Build and submit a sitemap

How does an XML sitemap work?

An XML sitemap works as a discovery hint: it hands search engines a list of URLs you consider important, so they do not depend only on links. Googlebot and Bingbot read the file, add new or changed URLs to the crawl queue and use the lastmod date to decide what to revisit. A sitemap does not guarantee crawling or indexing; Google calls it a hint.

A minimal sitemap with one URL looks like this:

  • <?xml version=”1.0″ encoding=”UTF-8″?>
  • <urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″>
  • <url><loc>https://example.com/de/kaffeemuehlen/</loc><lastmod>2026-10-01T09:00:00+00:00</lastmod></url>
  • </urlset>

XML sitemap rules and limits

Google’s documentation sets a small number of hard rules that every sitemap must follow:

RuleRequirement
SizeMax 50,000 URLs or 50 MB uncompressed per file
EncodingUTF-8
URLsAbsolute, canonical, returning status 200
ScopeCovers its own directory and below, unless submitted in Search Console
Sitemap indexGroups many sitemap files; Bing accepts up to 50,000 child sitemaps per index

lastmod, changefreq and priority

Google ignores changefreq and priority, and Bing ignores them too. Google uses lastmod only when it is consistently accurate, meaning it changes after real edits to the main content, structured data or links, not after a new copyright year in the footer. Bing recommends the full ISO 8601 date with time and warns against setting lastmod to the moment the sitemap was generated.

Types of sitemaps

Besides standard page sitemaps, Google supports image, video and news extensions, plus RSS, Atom and plain text formats. News sitemaps matter for publishers in Google News; image sitemaps help stores with large product galleries.

Who needs an XML sitemap?

An XML sitemap is most useful for large, new or media-heavy sites. Google says a site of about 500 pages or fewer, with good internal linking, may not need one. In practice I add one to every project, because it costs nothing and gives a clean list of indexable URLs to compare with what Google actually indexed.

How to submit an XML sitemap

You submit a sitemap by adding it in Search Console or listing it in robots.txt:

  • Add the sitemap URL in the Sitemaps report of Google Search Console and in Bing Webmaster Tools.
  • Add a line Sitemap: https://example.com/sitemap_index.xml to robots.txt.
  • Use IndexNow next to the sitemap for instant notifications to Bing and other participating engines.

The old Google ping URL no longer works: Google announced its deprecation on 26 June 2023 and switched it off by the end of that year.

XML sitemaps on multilingual and multi-country sites

An XML sitemap is one of 3 official places to declare hreflang, and on large international stores it is the one I prefer. Each url entry lists every language version, including itself, with xhtml:link elements, after the xhtml namespace is declared on the urlset:

  • <xhtml:link rel=”alternate” hreflang=”pl-PL” href=”https://example.com/pl/mlynki/”/>
  • <xhtml:link rel=”alternate” hreflang=”de-DE” href=”https://example.com/de/kaffeemuehlen/”/>
  • <xhtml:link rel=”alternate” hreflang=”cs-CZ” href=”https://example.com/cz/mlynky/”/>

I also split sitemaps per market (sitemap-pl.xml, sitemap-de.xml, sitemap-cz.xml). Combined with a separate Search Console property for each folder, this shows indexing coverage per country in one glance. Sitemaps can also list URLs from several domains, such as ccTLDs, once you verify each one in Search Console. Include only canonical URLs, never redirected or noindexed ones.

Sitemaps and AI search

Bing wrote in July 2025 that sitemaps remain a foundational signal for content discovery in AI-powered search and that it revisits sitemaps at least once a day. Accurate lastmod dates help fresh pages reach Copilot answers faster, which matters for AI SEO.

Pro tip: Compare the URLs in each market’s sitemap with the indexed pages in Search Console every month. A German sitemap with 8,000 URLs and 3,000 indexed pages points to a content or quality problem in that market, not a technical one.

Need a sitemap and hreflang setup for several countries? See my international SEO consultancy or order an SEO audit.

Frequently asked questions about XML sitemap

How many URLs can an XML sitemap contain?

One XML sitemap can contain up to 50,000 URLs or 50 MB uncompressed. Larger sites split URLs across several files and group them in a sitemap index.

Does Google use priority and changefreq?

No, Google ignores priority and changefreq. It uses lastmod only when the date is consistently accurate and reflects real content changes.

Does a sitemap guarantee indexing?

No, a sitemap is only a hint for discovery. Google still decides whether to crawl and index each URL based on quality and other signals.

Can I put hreflang in an XML sitemap?

Yes, Google accepts hreflang in XML sitemaps through xhtml:link elements. Each URL entry must list all language versions, including itself.

Related terms

International SEO · AI SEO (GEO)

Grow in every market, and get cited by AI

On a multi-country site the XML sitemap is both a crawl map and the easiest place to manage hreflang for thousands of URLs. I build per-market sitemaps and hreflang setups so every country version gets discovered by Google, Bing and AI search.

I help SaaS and e-commerce brands win organic traffic across Europe and the US, and get their brand recommended in ChatGPT, Gemini, Perplexity and Google AI Overviews. Every project starts with a free audit of your site, your markets and your visibility in AI answers.

Write to Adrian

Have a question about this term or your SEO?

Send a short message about your website, the markets you sell in and what you want to achieve. You get a reply from me, not from a sales team.

  • Free preliminary SEO and AI visibility audit
  • Strategy for international and multilingual markets
  • Reply within one business day
Book a free call
Adrian Dąbrowiecki

Write to Adrian

Adrian Dąbrowiecki · Marketer Coffee

Tell me about your site and your goals. I usually reply within one business day.