XML sitemap 

XML sitemap: your website’s directory for search engines

A man with a headset sits smiling at a desk, a woman works in the background.
Ralph Grundmann · Last updated on 19 October 2026

An XML sitemap is a file that lists the addresses of a website that should be found and indexed by search engines. It helps Google discover new and changed pages more quickly, especially on large or new websites. It is not a guarantee of being indexed. Here you can read how a sitemap is structured and which mistakes you should avoid.

What is an XML sitemap?

Search engines find pages mainly by following links. A sitemap complements this: it lists the addresses directly, often together with the date of the last change. The format is defined in the sitemap protocol, which Google, Bing and other search engines support.

The sitemap is a hint, not an instruction. Google decides for itself which of the listed pages it crawls and adds to its index. Our entry on indexing explains how this step works.

An XML sitemap should not be confused with an HTML sitemap: a normal page with links for visitors, like a table of contents.

Do I need an XML sitemap?

Google names three cases in which a sitemap is particularly helpful:

  • The website is large, so individual pages can easily end up without links.
  • The website is new and has few links from other websites.
  • The website has a lot of video and images or appears in Google News.

For small websites with about 500 pages or fewer that are comprehensively linked internally, Google says a sitemap may not be needed. It does no harm, though. Most content management systems and SEO plugins generate one automatically anyway.

Structure of an XML sitemap

The sitemap protocol requires only a few elements:

  • urlset encloses the whole list.
  • url stands for one entry.
  • loc contains the full address including https and the domain.
  • lastmod is optional and gives the date of the last change, for example 2026-10-19.

The fields changefreq and priority are also provided for in the protocol, but according to Google they are ignored. Google only uses the date in lastmod if it is consistently accurate. It should therefore only change when the main content, the structured data or the links of a page change, not for every small detail such as the year in the copyright notice.

A sitemap may contain no more than 50,000 addresses and must not be larger than 50 MB uncompressed. It must be UTF-8 encoded. Larger websites split their addresses across several sitemaps, for example by page type, and combine them in a sitemap index file. This also makes monitoring easier, because Search Console evaluates each sitemap separately.

Which URLs belong in the sitemap?

The sitemap should only contain pages that are meant to appear in search results. That means:

  • The page returns the status code 200.
  • It is indexable, i.e. not excluded with noindex.
  • It is the preferred version, which the canonical tag also points to.
  • It is not blocked for search engines in the robots.txt file.

Redirected addresses, error pages, parameter variants and internal search results do not belong in it. If the sitemap contains such addresses, it sends conflicting signals: it says “please index”, while the page itself says something else. One exception is the temporary additional sitemap with the old addresses during a site move, see the next section.

Submitting and monitoring the sitemap

Google finds a sitemap in three ways:

  • via the “Sitemaps” report in Google Search Console,
  • via the Search Console API,
  • via a line in the robots.txt file, such as Sitemap: https://www.example.co.uk/sitemap.xml. This also works for other search engines.

Google recommends placing the sitemap in the root directory of the domain. If it sits in a subfolder and is not submitted via Search Console, it only applies to the pages in that folder.

In the Sitemaps report, you can see whether Google was able to read the file and how many addresses it found. Compare this number with the page indexing report: if many pages from the sitemap are left out, it is worth looking for the cause. During a relaunch with new addresses, temporarily submit an additional sitemap with the old addresses that now 301 redirect to the new ones. This lets you see in Search Console how indexing shifts to the new addresses. Once the move is complete, remove this sitemap again. Checking the sitemap, robots.txt and canonicals is part of technical SEO.

Does your sitemap contain errors, or is Google only indexing some of your pages? Then get in touch with us or read more about our technical SEO!

 Frequently asked questions 

XML sitemap: key questions

How many URLs can an XML sitemap contain?

No more than 50,000 addresses, with a file size of no more than 50 MB uncompressed. Larger websites distribute their addresses across several sitemaps and combine them in a sitemap index file.

Does a sitemap guarantee that my pages will be indexed?

No. The sitemap helps Google find pages. Whether a page is crawled and indexed is decided by Google itself, based on factors including quality and technical accessibility.

How do I submit a sitemap to Google?

The easiest way is the “Sitemaps” report in Google Search Console. You can also add the sitemap address to your robots.txt file, so that other search engines can find it too.

Do priority and changefreq still need maintaining?

Not for Google, which ignores both values. A correct lastmod date that only changes when the page changes significantly is more important.

 Request a consultation 

Questions about this topic?

Tell us briefly what it is about. You will speak directly to Ahmed Badia.
Microsoft Partner Badge
SISTRIX certified agency
4.9
Based on 33 reviews
Request a consultation
Ahmed Badia
Ahmed BadiaSenior Software Developer Team LeadCall: 0228 243 313 54

* Required

Please enter your name.

Please enter a valid email address, e.g. name@company.com.

For a call back.

Please enter your number with area code, e.g. 0228 243 313 53 or +49 228 243 313 53.

Please tell us briefly what it is about.

Free and without obligation. We usually reply within 24 hours on working days.

Information on how we process your data: Privacy policy