An XML sitemap is a file, usually named sitemap.xml, that lists the pages on a website for search engines to crawl and index. A single sitemap holds up to 50,000 URLs or 50 MB uncompressed. Google reads it to find pages that links alone might miss, especially on large or new sites.

Key facts

  • A sitemap lists canonical URLs, with an optional lastmod date for each page.
  • One sitemap file holds at most 50,000 URLs or 50 MB uncompressed.
  • Google ignores priority and changefreq tags, but uses lastmod when it is accurate.
  • Submitting a sitemap is only a hint and does not guarantee indexing.
  • Sites with about 500 pages or fewer and good internal links may not need one.
  • Sitemaps can also cover images, video, news, and alternate language versions.

Sitemap formats

FormatBest forExtra data
XMLMost sitesImages, video, news, alternate languages
RSS, mRSS, Atom 1.0Sites with feedsVideo
TextVery large sitesURLs only

What goes inside an XML sitemap

Each entry in a sitemap is one URL wrapped in url tags, with the address itself in a loc tag. The loc tag is the only required tag. An optional lastmod tag records the date of the last meaningful update, and Google uses it when it is consistently accurate.

TagRequiredWhat it does
locYesThe page URL
lastmodNoDate of last meaningful update
changefreqNoHow often the page changes (ignored by Google)
priorityNoImportance from 0.0 to 1.0 (ignored by Google)
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/foo.html</loc>
    <lastmod>2022-06-04</lastmod>
  </url>
</urlset>

Two more tags exist but add little value. Google ignores priority, which scores a page from 0.0 to 1.0, and changefreq, which states how often a page changes. Extensions add image, video, and news data to the same file.

Size limits and sitemap indexes

A single sitemap file holds at most 50,000 URLs or 50 MB uncompressed, in every format Google supports. Larger sites must split their URLs across several sitemap files. A sitemap index file lists those files so Google can find them all from one place.

Files must be UTF-8 encoded, and every URL must be absolute, starting with the full domain. Google recommends hosting the sitemap at the site root, so it covers every page. List only canonical URLs, the versions you want in search results.

How to submit your sitemap

The simplest route is a line in robots.txt naming the sitemap location, which Google reads on its next crawl of that file. You can also submit it in Google Search Console, where the Sitemaps report shows when Googlebot read it and any processing errors.

Submitting a sitemap is only a hint. Google may choose not to download it or to crawl only some of the URLs it lists. A sitemap helps discovery, but it does not guarantee that a page will be indexed or ranked.

When you can skip one

Google says you may not need a sitemap if your site is small, about 500 pages or fewer, and every important page is reachable through internal links from the home page. You also may not need one if you have few images, videos, or news pages to surface in search.

You likely do need one if your site is large, new with few external links, or full of rich media. In those cases, crawlers may miss new pages without a direct list to follow. For a full technical checklist, see seo checklist.

For the file that points crawlers to your sitemap, see what is a robots.txt file.

FAQ

What is an XML sitemap?

An XML sitemap is a file, usually named sitemap.xml, that lists the pages on a website for search engines to crawl and index.

How many URLs can a sitemap hold?

One sitemap file holds at most 50,000 URLs or 50 MB uncompressed. Larger sites split URLs across several files listed in a sitemap index.

Does a sitemap guarantee indexing?

No. Submitting a sitemap is only a hint to Google, which may crawl some, all, or none of the URLs it lists.

Do small sites need a sitemap?

Usually not. Google says sites with about 500 pages or fewer and good internal links may not need one, though a sitemap still helps discovery.

What is the difference between an XML sitemap and an HTML sitemap?

An XML sitemap is written for search engine crawlers, while an HTML sitemap is a page of links written for human visitors to navigate a site.

Sources