XML sitemap (sitemap.xml). What it means.

An XML sitemap is a file that lists the URLs on a website you want search engines to crawl, with optional details such as when each page was last updated.

By Brady Heinrich · Updated

Definition

An XML sitemap is a file that lists the URLs on a website you want search engines to crawl, with optional details such as when each page was last updated.

What is an XML sitemap?

An XML sitemap is a machine-readable list of a site's pages, written for search engines. Google describes a sitemap as a file where you provide information about the pages, videos and other files on your site, which search engines read to crawl the site more efficiently.

It is a discovery aid, not a command. Google states that a sitemap does not guarantee every listed item will be crawled and indexed, and that leaving a URL out does not stop it being indexed if Google finds it through links.

Do you need a sitemap?

Google's guidance depends on the site.

You probably need one ifYou might not if
The site is largeThe site is small, about 500 pages or fewer
The site is new, with few external linksEvery important page is reachable by links from the home page
It has a lot of video, images or news contentIt has little media or news content you need in search

Even so, Google adds that in most cases a site will benefit from having one, and most CMS platforms generate it automatically.

What does a sitemap look like?

A sitemap is a list of url entries inside a urlset element. Each entry has a loc value, the full address of the page, and can have a lastmod value, the date the page last changed in a meaningful way. Large sites use a sitemap index: a file that lists several sitemaps.

Google's limits are 50,000 URLs or 50 MB uncompressed per sitemap file. Beyond that, split the list into several files.

How do you create and submit a sitemap?

  1. Generate it from your CMS, framework or a sitemap plugin, so it updates when pages change.
  2. Include only canonical, indexable URLs that return a normal page. Leave out redirects, error pages, duplicates and anything marked noindex.
  3. Use absolute URLs.
  4. Keep lastmod honest. Change it when the content changes.
  5. Submit it in Google Search Console and reference it with a Sitemap line in robots.txt.
  6. Check the report afterwards for URLs submitted but not indexed.

XML sitemap vs HTML sitemap

An XML sitemap is for crawlers. An HTML sitemap is an ordinary page of links for people, and acts as internal linking. The first helps pages get found. Neither replaces a site structure where important pages are a few clicks from the home page.

Sitemap vs robots.txt

A sitemap says "these are the pages I want crawled". Robots.txt says "do not fetch these". They should never contradict each other: a URL listed in the sitemap must not be blocked.

An example

A site publishes 2,000 programmatic pages in one release. Only pages linked from the home page are found in the first fortnight. After the new URLs are added to a sitemap with accurate lastmod dates and submitted in Search Console, the Page Indexing report shows Google discovering the rest.

The common mistake

Listing everything. A sitemap full of redirects, parameter URLs and noindexed pages tells search engines your list cannot be trusted. It should contain only the pages you want in search results.

How people search for XML sitemap

  • sitemap12,100 a month
  • xml sitemap1,600 a month
  • what is a sitemap1,600 a month
  • sitemap example1,300 a month
  • what is an xml sitemap260 a month

US monthly searches, Google Ads keyword data.

Related terms

Go deeper

Building something ambitious? Let's talk.

We reply within one business day.