An XML sitemap is a file that lists the URLs on a website that the owner wants search engines to crawl, with optional details such as when each page last changed [1][2]. The format is defined by the open Sitemaps protocol at sitemaps.org and is supported by Google, Bing and other search engines [1][14]. A sitemap is a hint: it helps discovery but does not guarantee that listed pages will be crawled or indexed [2].
- Sitemaps help most on large or new sites, and sites with weak internal linking [2].
- A file holds up to 50,000 URLs or 50 MB uncompressed; bigger sites use a sitemap index [1][4].
- Google uses loc and lastmod, and ignores priority and changefreq [3].
- List only canonical, indexable URLs that return 200 [3][12].
1Overview
Search engines find most pages through links. A sitemap gives them a second route: a list of URLs the site owner considers important, which can include pages that are new, poorly linked or deep in the site [2].
Google says a sitemap is most useful for sites that are large, new with few external links, have many pages not well linked to each other, or have a lot of rich media or news content. A small site with good internal links may not need one [2].
2History
The Sitemaps protocol began as a Google format and was published at sitemaps.org as version 0.90 under a Creative Commons licence, after which it was adopted by other major search engines [1]. Later additions included the Sitemap: line in robots.txt for automatic discovery [1].
In June 2023 Google retired its sitemap “ping” endpoint, saying most pings it received were not useful, and confirmed it would use <lastmod> only when it is consistently accurate [5].
3Supported formats
4XML structure
An XML sitemap has a <urlset> root element with the sitemaps.org namespace, and one <url> block per page [1].
| Tag | Required | Meaning | Used by Google |
|---|---|---|---|
| loc | Yes | Absolute URL of the page [1] | Yes [3] |
| lastmod | No | Last modification date, in W3C Datetime format [1][13] | Yes, if accurate [3][5] |
| changefreq | No | How often the page is likely to change [1] | No [3] |
| priority | No | Relative priority, 0.0–1.0, default 0.5 [1] | No [3] |
Files must be UTF-8 encoded, and characters such as & in URLs must be entity-escaped [1].
5Size limits and index files
Each sitemap file may contain at most 50,000 URLs and be no larger than 50 MB uncompressed; files may be gzip-compressed for transfer [1][3].
Larger sites split their URLs across several sitemaps and list them in a sitemap index file, which uses a <sitemapindex> root and the same limits. The index can be submitted once instead of each file [1][4].
Splitting by content type, products, categories, articles, has a practical benefit: reports per file show which part of the site has indexing problems.
6Location and submission
Google recommends placing the sitemap at the site root. A sitemap generally affects only URLs in the directory it is placed in and below [3].
- Submit it in Search Console’s Sitemaps report, which shows when it was last read and any errors [6].
- Add a
Sitemap:line to robots.txt so any crawler can find it; the line can appear more than once and is independent of user-agent groups [11]. - Since the 2023 ping retirement, Google relies on these two methods and on recrawling known sitemaps [5].
7Extensions
Google supports sitemap extensions that add information about specific content types [3]:
- Image: lists images on each page, helping Google find images it might not otherwise discover [7].
- Video: describes video content such as title, thumbnail and duration [8].
- News, for publishers in Google News, listing recently published articles [9].
- hreflang: declares localised alternates for each URL, as an alternative to HTML tags [10].
8What to include
Google asks for the full, absolute URLs of the pages you want shown in search: the canonical versions [3]. Listing a URL in a sitemap is a weak canonicalisation signal, so it should agree with redirects and rel="canonical"[12].
9Common misconceptions
| Belief | What the sources say |
|---|---|
| Priority tells Google which pages matter most | Google ignores priority [3] |
| Every listed URL will be indexed | A sitemap is a hint only [2] |
| Updating lastmod on every build helps | Google uses lastmod only when it is consistently accurate [5] |
| Pinging Google after each update is required | The ping endpoint was retired in 2023 [5] |
See also
- Sitemaps guide: diagrams and quick fixes
- Web crawling: links as the first discovery path
- Search indexing: why only canonical URLs belong
- Sitemap Validator: check a sitemap instantly
References
- [1]“Sitemaps XML format”. sitemaps.org. www.sitemaps.org/protocol.html
- [2]“Learn about sitemaps”. Google Search Central. developers.google.com/search/docs/crawling-indexing/sitemaps/overview
- [3]“Build and submit a sitemap”. Google Search Central. developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap
- [4]“Manage your sitemaps using a sitemap index file”. Google Search Central. developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps
- [5]“Sitemaps ping endpoint is going away”. Google Search Central Blog, June 2023. developers.google.com/search/blog/2023/06/sitemaps-lastmod-ping
- [6]“Manage sitemaps with the Sitemaps report”. Search Console Help. support.google.com/webmasters/answer/7451001
- [7]“Image sitemaps”. Google Search Central. developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps
- [8]“Video sitemaps and alternatives”. Google Search Central. developers.google.com/search/docs/crawling-indexing/sitemaps/video-sitemaps
- [9]“Create a News sitemap”. Google Search Central. developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap
- [10]“Tell Google about localized versions of your page”. Google Search Central. developers.google.com/search/docs/specialty/international/localized-versions
- [11]“How Google interprets the robots.txt specification”. Google Search Central. developers.google.com/search/docs/crawling-indexing/robots/robots_txt
- [12]“How to specify a canonical URL with rel="canonical" and other methods”. Google Search Central. developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
- [13]“Date and Time Formats (W3C Datetime)”. W3C Note, 1997. www.w3.org/TR/NOTE-datetime
- [14]“Bing Webmaster Guidelines”. Microsoft Bing. www.bing.com/webmasters/help/webmaster-guidelines-30fba23a