E-commerce & international

hreflang sitemap

Also called: hreflang in sitemap, hreflang xml sitemap, xhtml:link sitemap, hreflang sitemap annotations

A hreflang sitemap is an XML sitemap that declares each page's language and regional variants with xhtml:link elements, instead of placing hreflang tags in the HTML head or an HTTP header. Every URL entry must list all alternate versions, including itself, so Google can match the right locale to each searcher.

Google supports three equivalent ways to declare hreflang: <link> tags in the HTML head, an HTTP Link header, and the XML sitemap method. The sitemap approach moves all the annotations into one file, which is why sites with many locale variants lean on it. Google notes there is no ranking benefit to using more than one method at a time.

How it is structured

You declare the namespace on the urlset, then give each <url> a <loc> plus one <xhtml:link> per variant, including a self-reference.

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://example.com/en/product</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/product"/>
    <xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/produkt"/>
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/product"/>
  </url>
</urlset>

Rules that trip people up:

How it affects your traffic

For a store selling the same catalog across countries, near-identical product and category pages in different locales compete with each other, and Google can surface the wrong-language URL or pick one variant and ignore the rest. A clean hreflang sitemap tells Google which URL belongs to which market, so the /de/ page shows in Germany and the /en-us/ page shows in the US instead of cannibalizing each other. It also protects impressions you already earn, since a single broken return link can make Google ignore the annotations for the whole cluster. Getting this right across thousands of SKUs is the kind of technical cleanup we handle in E-commerce SEO.

Get E-commerce SEO that moves the needle

We turn terms like this into ranked pages and qualified pipeline. Start with a free Initial SEO Strategy.