What is XML Sitemap (sitemap.xml)?

An XML sitemap is a file listing a site's important URLs to help search engines discover and crawl pages efficiently.

An XML sitemap is a structured file, conventionally named sitemap.xml, that lists the URLs on a website you want search engines to know about. Each entry can include optional metadata such as the last-modified date, change frequency, and priority. The sitemap acts as a roadmap, helping crawlers discover pages they might otherwise miss, especially on large or poorly linked sites.

Sitemaps are particularly valuable for new sites with few external links, large sites where deep pages are hard to reach through internal linking, and sites with rich media or content that is not easily discovered by following links. By listing canonical URLs and their freshness, a sitemap nudges search engines toward crawling the right pages and re-crawling updated ones sooner.

The format has practical limits: a single sitemap file can contain up to 50,000 URLs and must not exceed 50 MB uncompressed. Sites that exceed these limits split their URLs across multiple sitemaps and reference them all from a sitemap index file. Compressing sitemaps with gzip and submitting them through search consoles are common optimizations.

A sitemap should list only indexable, canonical URLs that return a 200 status — including redirected, noindexed, or blocked URLs sends mixed signals and wastes crawl budget. Referencing the sitemap from robots.txt and keeping last-modified dates accurate maximizes its usefulness. Extracting or splitting URLs from an existing sitemap is a common task when auditing or migrating a site.

Examples

  • <url><loc>https://example.com/</loc><lastmod>2024-01-15</lastmod></url>
  • A sitemap index referencing sitemap-1.xml through sitemap-9.xml
  • Splitting a 120,000-URL site into three 50,000-URL sitemaps plus an index

Frequently asked questions

Free tools for working with XML Sitemap (sitemap.xml)

Related terms