Skip to content

Sitemap

A sitemap is an XML file at /sitemap.xml that lists the URLs a site wants crawlers to discover and index, with optional metadata: last modified date, change frequency, priority and alternates.

Definition

What it is

The sitemaps protocol is simple. /sitemap.xml contains a <urlset> with one <url> per page. Each <url> has at minimum a <loc> (the absolute URL), and optionally <lastmod> (ISO 8601 date), <changefreq> (always, hourly, daily, weekly, monthly, yearly, never) and <priority> (0.0–1.0). For multilingual sites, each <url> can also carry <xhtml:link rel="alternate" hreflang="…" href="…"/> entries, which tell crawlers that the URL has equivalents in other languages.

A sitemap is a hint, not a contract. It does not guarantee indexing. It accelerates discovery, especially for large sites where crawlers might otherwise miss new pages.

Why it matters

A new page on a small site might wait weeks for a crawler to find it through links. A sitemap is a direct line: a crawler that reads it learns about the page the next time it checks. For large sites, sitemaps are essential: a 1M-URL site with no sitemap relies entirely on internal linking, which is fragile. Google Search Console reports how many URLs from a sitemap were indexed, which is the only real health check.

Sitemap index vs urlset

Aspect

urlset

sitemapindex

Root element

<urlset>

<sitemapindex>

Children

<url>

<sitemap>

Max URLs

50,000

50,000 sitemaps

Max size

50 MB uncompressed

50 MB uncompressed

Typical use

Small to medium sites

Large sites

Discovery

/sitemap.xml or robots.txt

/sitemap.xml (index)

The sitemap protocol at a glance

  1. 2005 — Google publishes the Sitemaps protocol.

  2. 2006 — Yahoo!, Microsoft and Google jointly adopt sitemaps.org 0.9.

  3. 2011 — <xhtml:link hreflang> documented for multilingual sites.

  4. 2020 — Google announces the Sitemaps ping endpoint is deprecated.

  5. 2023 — Sitemaps protocol remains unchanged; the 2006 spec is still authoritative.

How to build sitemaps that work

Sitemaps that crawlers love

  1. Absolute URLs only

    <loc>https://example.com/page/</loc>, not <loc>/page/</loc>. Relative URLs are silently ignored.

  2. Include `<lastmod>`

    An accurate <lastmod> tells the crawler which pages changed. Do not update it when nothing changed.

  3. Split above 50,000 URLs

    Use a sitemapindex. Each child sitemap stays under 50k URLs and 50 MB.

  4. One sitemap per language

    /sitemaps/sitemap-en.xml, /sitemaps/sitemap-es.xml, with <xhtml:link> alternates in each.

  5. Submit in Search Console

    The "Sitemaps" report in Search Console is the only real health check. Check it after every deploy.

Common failures

Origin

The word is literal: a map of a site. Human-readable HTML sitemaps existed on web pages since the 1990s — a single page listing all pages of the site, for visitors. When Google published the XML Sitemaps protocol in 2005, it borrowed the word: an XML map of the site, for crawlers.

Sitemaps are a way to tell Google about pages on your site we might not otherwise discover. In its simplest terms, a sitemap is an XML file that lists URLs for a site along with additional metadata about each URL.

— Google Search Central, *Learn about sitemaps*, 2024
2005 · Google publica el protocolo Sitemaps
2006 · sitemaps.org 0.9, adoptado por Yahoo!, Microsoft y Google
2011 · `<xhtmllink hreflang>` documentado
2020 · Google depreca el ping endpoint
50,000 · URLs máximo por sitemap

Evidence

FAQ

Does a sitemap improve ranking?

Not directly. It accelerates discovery and can improve indexing, but ranking depends on content and links.

How often to regenerate?

On every deploy, or on a schedule (daily for large sites). Stale sitemaps delay discovery.

Sitemap vs robots.txt?

robots.txt says "do not crawl", sitemap says "please crawl". A URL blocked by robots.txt is effectively invisible even if it is in the sitemap.

Do I need a sitemap for a 5-page site?

Not strictly, but it costs nothing and helps. Submit it anyway.

Connections

Etymology

Origin: compound

  • site (noun): from Latin situs, "position, place"
  • map (noun): from Latin mappa, "cloth, napkin"; extended to a drawing of the world

Semantic network

SitemapwebSEOCrawlerrobots.txtXML sitemahreflangSEO

● broader ● narrower ● related

Broader

Related

Used in the garden

Sources