Guide : XML Sitemap

Ce que an XML sitemap is, its anatomy, the ignored tags (priority/changefreq), accurate lastmod, the 50 000/50MB limites, hreflang in sitemaps, and how to submit un.

Première publication : 22 juin 2026 · Dernière mise à jour : 3 août 2026 · Advanced
Langues
1 indice probant sur cette page

An XML sitemap is a UTF-8 fichier listing the canonical, indexable URLs vous vouloir moteur de recherches to know à propos de — chaque in a <url> block with a requis <loc> and an optional <lastmod>. It helps engines découvrir URLs but doesn't guarantee indexation; its réel payoff is the submitted-vs-indexed diagnostic in Search Console. Google ignores <priority> and <changefreq>, and uses <lastmod> seulement quand it's verifiably accurate (significant updates, pas a blanket 'today'). Un sitemap caps at 50 000 URLs or 50MB uncompressed — past que vous split fichiers and référence les from a sitemap index. Inclure seulement canonical, indexable, 200-status URLs; leaving une URL out of le sitemap n’est pas the même as noindexing it. Sitemaps are aussi the easiest placer to manage hreflang at scale. Référence it in robots.txt and submit it in Search Console and Bing Webmaster Outils.

TL;DR — An XML sitemap is a UTF-8 fichier of canonical, indexable <loc> URLs, chaque optionally carrying a <lastmod>. It aids discovery, pas indexation — the payoff is the submitted-vs-indexed signal in Search Console. Google ignores <priority> and <changefreq> and uses <lastmod> seulement quand it’s verifiably accurate (significant updates, jamais a blanket “today”). Un fichier caps at 50 000 URLs or 50MB uncompressed — past que, split and utiliser a sitemap index. Inclure seulement 200, canonical, indexable URLs; excluding une URL n’est pas the même as noindexing it. XML isn’t the seulement accepted format (RSS/Atom/txt fonctionner aussi), and sitemaps are the easiest placer to manage hreflang at scale — though ceux annotations go live on a lag, pas instantly. Référence it in robots.txt and submit it in Search Console + Bing Webmaster Outils.

Evidence for this claim The XML sitemap protocol lists canonical URL locations and optional metadata, with limits of 50,000 URLs and 50 MB uncompressed per sitemap. Scope: Sitemaps protocol and current Google-supported limits. Confidence: high · Verified: Sitemaps XML format Evidence for this claim Google treats sitemaps as discovery hints rather than guarantees and supports submission through Search Console or robots.txt references. Scope: Current Google sitemap behavior and submission methods. Confidence: high · Verified: Google Search Central: Build and submit a sitemap

Ce que an XML sitemap en réalité is

An XML sitemap is a fichier, written to the sitemaps.org 0.9 protocol, que listes l’URLs on votre site vous vouloir engines to know à propos de. Google’s propre definition: “A sitemap is a fichier où vous provide information à propos de lune pages, videos, and autre fichiers on votre site, and the relationships entre les.” It’s a discovery aid and a coverage diagnostic — explicitly pas a guarantee: “A sitemap helps search engines découvrir URLs on votre site, but it doesn’t guarantee que tout the items in votre sitemap va be crawled and indexé.”

Que framing matters, parce que it’s où a lot of effort obtient misspent. The sitemap isn’t a ranking lever and it isn’t an indexation command. Here’s an annotated minimal exemple:

<?xml version="1.0" encoding="UTF-8"?>            <!-- XML declaration; UTF-8 -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">  <!-- root + namespace -->
  <url>                                           <!-- one entry per page -->
    <loc>https://www.example.com/foo.html</loc>   <!-- required: absolute URL -->
    <lastmod>2026-06-04</lastmod>                 <!-- optional: last significant change -->
  </url>
</urlset>

Anatomy

  • The XML declaration<?xml version="1.0" encoding="UTF-8"?>. Google is unambiguous ici: “The sitemap file must be UTF-8 encoded.” Obtenir the encoding incorrect and special characters break.
  • <urlset> + namespace — the root element, with xmlns="http://www.sitemaps.org/schemas/sitemap/0.9". The namespace is ce que indique the parser ce is a sitemap; the incorrect or manquant namespace is a courant Search Console error.
  • <url> — un block par page.
  • <loc> — requis. “Use fully-qualified, absolute URLs in your sitemaps” — pas relative paths, and sous ~2 048 characters. Tout valeurs doit be entity-escaped: & becomes &amp;, ' becomes &apos;, " becomes &quot;, > becomes &gt;, and a literal less-than becomes &lt;.
  • <lastmod> — optional; the date lune page dernier significantly modifié (plus on the honesty rule ci-dessous).
Evidence for this claim Each loc must be a fully qualified absolute URL and XML special characters must be entity escaped. Scope: XML/HTTP sitemap generation, hosting and submission Confidence: high · Verified: Build and submit a sitemap

The ignored-tags truth

Ce is the unique la plupart out-of-date chose in la plupart sitemap tutorials. Two legacy tags — <priority> and <changefreq> — are ignored by Google. Gary Illyes appelé priority “essentially a bag of noise,” and John Mueller has said priority and modifier frequency “doesn’t really play que beaucoup of a role with Sitemaps anymore.” Bing has confirmed the même: changefreq and priority ne … plus affecter its exploration or ranking. Vous pouvez leave les in (ils do aucun harm) or strip les out — ils simply don’t do anything.

<lastmod> is différent — ne faites pas lump it in with the ignored tags. Google fait utiliser <lastmod>, but seulement quand it trusts it, and que trust is roughly binary: soit Google believes votre dates or it doesn’t. The rule is que the date devrait reflect a significant modifier — “an mettre à jour to the principal content, the données structurées, or liens on lune page is généralement considéré significant, cependant an mettre à jour to the copyright date n’est pas.” The échec mode I voir constantly is stamping every URL with today’s date on every construire. That’s self-defeating: Mueller has appelé it “just lazy,” noting it’s trivial pour engines to recognize and seulement rend it harder pour les to spot genuinely mis à jour pages. Lie souvent suffisant and, in Google’s words, “eventually we’re pas going to believe vous anymore.” Bing leans même harder on <lastmod> as a freshness signal que Google fait — so an accurate date helps vous on les deux engines, and a fake un hurts vous on les deux.

Placement, naming, encoding, and compression

  • Placement/naming. There’s aucun requis filename, but /sitemap.xml at the root is the convention. By par défaut a sitemap seulement affecte URLs at or ci-dessous its propre chemin, so garder it élevé suffisant to cover everything it listes. The un exception: vous pouvez host a sitemap pour a différent site si you’ve verified ownership of que site and its robots.txt points back to le sitemap’s réel emplacement — Google calls ce cross-submission, and it’s the mechanism behind a sitemap index aggregating sitemaps hosted elsewhere.
  • Encoding. UTF-8, toujours.
  • Compression. You’re allowed to gzip a sitemap (serve it as .xml.gz), qui is worth doing on grand fichiers. Important nuance: the 50MB cap is mesuré uncompressed — gzip saves bandwidth, pas headroom contre the size limite.

Limites → split + sitemap index

A unique sitemap is capped at 50 000 URLs or 50MB uncompressed, whichever comes premier. Google states it directement: “Tout formats limite a unique sitemap to 50MB (uncompressed) or 50 000 URLs.” Quand vous blow past soit limite, vous split the liste à travers multiple sitemap fichiers and référence les tout from a sitemap index — a sitemap of sitemaps. That’s its propre sibling topic; La version courte is que vous submit the index, and un index peut point at up to 50 000 child sitemaps, so you’ll jamais en réalité run out of capacity.

Qui URLs to inclure — and “exclude ≠ noindex”

Inclure seulement URLs que are indexable, canonical, and retourner 200. Que signifie aucun 3xx redirections, aucun non-canonical duplicates, aucun noindex pages, aucun robots-blocked URLs. A clean sitemap of exactly votre indexable définir is ce que rend the Search Console submitted-vs-indexed comparison meaningful — pollute it with junk and you’ve thrown away the diagnostic.

Now the mechanical point personnes obtenir incorrect: excluding une URL from votre sitemap fait pas deindex it. Le sitemap is an advertisement, pas a gate. Removing une URL’s entry simplement arrête vous advertising que page; si Google déjà knows à propos de it (via liens, history, or un autre source) it stays dans l’index. The seulement mechanisms que en réalité supprimer une page are a noindex directive (with exploration allowed so Google peut voir it), a 404/410, or the removals outil. So “take it out of the sitemap” is jamais the correct réponse to “how do I deindex this.”

Accepted sitemap fichier formats

XML isn’t the seulement format Google accepts — worth knowing so vous don’t assume you’re stuck hand-writing XML. Google calls XML “the la plupart versatile of le sitemap formats,” but it aussi reads:

  • RSS 2,0 / Atom feeds — handy parce que nombreux CMSs déjà publish un; ils carry page URLs seulement.
  • mRSS — a media RSS feed, utilisé pour video.
  • Plain text (.txt) — literally un URL per line, web-page URLs seulement, UTF-8.

XML is encore the correct par défaut parce que it’s the seulement format que supports the extensions (lastmod metadata, image, video, and hreflang annotations). The others are URL-only.

hreflang in sitemaps

Si vous run a multilingual or multi-regional site, le sitemap is usually the easiest placer to manage hreflang — vous maintain the whole language cluster in un fichier au lieu de injecting return-tags into every page template. (It’s un of the three valid places hreflang peut live; the <head> and HTTP headers are the others.)

How it’s implemented. Chaque <url> obtient xhtml:link rel="alternate" children, un per language/region version, and vous declare the namespace xmlns:xhtml="http://www.w3.org/1999/xhtml" on <urlset>:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://www.example.com/english/page.html</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/english/page.html"/>
    <xhtml:link rel="alternate" hreflang="de" href="https://www.example.de/deutsch/page.html"/>
    <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/english/page.html"/>
  </url>
  <!-- each alternate URL repeats the FULL set, including itself (return tags) -->
</urlset>

The return-tag rule. Ce is the partie que bites personnes. Every <url> element doit liste every alternate version of lune page — notamment itself. Google: “Chaque <url> element doit have a child element <xhtml:link rel="alternate" hreflang="[supported_language-code]"> que listes every alternate version of the page, notamment itself.” And it has to be bidirectional: “Si page X liens to page Y, page Y doit lien back to page X. Si ce n’est pas the cas pour tout pages que utiliser hreflang annotations, ceux annotations may be ignored or pas interpreted correctement.” Ajouter an x-default entry pour the unmatched-language fallback. A unique broken or manquant return-tag peut invalidate the whole définir.

The cap counts <loc> URLs seulement. A relief pour big international sites: the 50 000-URL limite counts seulement the <loc> page URLs, pas the hreflang alternates. So a sitemap with 50 000 pages, chaque with ten language alternates, encore fits — it’s the emplacement URLs que count, pas the alternative URLs.

Quand it en réalité goes live — budget days, pas minutes. Here’s the expectation to définir, and it’s mechanism plutôt que a quotable line. Google parses votre sitemap hreflang quand it re-fetches le sitemap, but the annotations seulement prendre effect une fois tout l’URLs in the définir have been (re)crawled and the return-tags reconciled contre chaque autre. Que signifie there’s a réel lag entre publishing the hreflang and the alternates being honored, and un slow-to-recrawl or broken URL in the définir peut hold the rest up. Don’t expect it to flip on the moment vous submit — plan pour it to settle over days.

Référence it and submit it

  • robots.txt — ajouter a Sitemap: line with the complet absolute URL. Ce aussi lets engines auto-discover it.
  • Recherche Google Console — le sitemaps report (or the Search Console API) is the principal submission méthode; it’s aussi où vous lire the submitted-vs-indexed diagnostic.
  • Bing Webmaster Outils — submit là aussi; Bing récupère it quickly and rechecks regularly.

Un automation remarque from how I think à propos de ce: a sitemap devrait be generated automatically from lune pages vous en réalité have, so it stays current. A hand-built sitemap rots the moment votre site changements. The siblings to ce page — the sitemaps overview, the sitemap index pour grand sites, and the image sitemap and video sitemap extensions — cover the rest of the family, and the broader discovery topic ties sitemaps to the autre façons engines trouver votre URLs.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.