Skip to content

Library Guides

Hreflang for online shops: languages, countries and x-default

When a shop needs hreflang, the three ways to declare it, valid language and country codes, x-default, a five-market example and the mistakes Google lists.

By CentralUpdated 23 November 202612 min read8 sources, checked 23 November 2026
On this page
  1. When a shop needs hreflang
  2. The three ways to declare hreflang
  3. The codes: language first, region optional
  4. Return links, self-reference and x-default
  5. Canonical and hreflang together
  6. Worked example: one headlamp, five markets
  7. The mistakes Google lists
  8. How to test
  9. Does Bing use hreflang?
  10. Where Central helps

In short

  • Hreflang tells search engines which URL holds the same page for another language or country, so a searcher gets the version made for them.
  • Google reads hreflang from link elements in the HTML head, from an HTTP Link header or from an XML sitemap, treats the three methods as equal and sees no benefit in using more than one.
  • A value is an ISO 639-1 language code, optionally followed by an ISO 3166-1 alpha-2 region code: en-GB is valid, en-UK has no effect, and a region code alone is not valid.
  • Every version must list itself and all other versions; Google says that if two pages do not both point to each other, the tags are ignored.
  • The reserved value x-default names the fallback page for searchers whose language settings match none of your versions.
  • Bing's webmaster blog of December 19, 2025 tells site owners to use hreflang to define language and regional targeting; Bing's Webmaster Guidelines do not mention it.
Hreflang generatorFree tool

When a shop needs hreflang#

You need hreflang as soon as the same product has more than one URL because of language or country. Google asks you to tell it about these variations, because "doing so will help Google Search point users to the most appropriate version of your page by language or region" (Google Search Central).

Your shopHreflang?Why
One language, one countryNoEach product has one page; there is nothing to connect
The same products in German and in EnglishYesGoogle's case of a site that is fully translated into multiple languages
One language for several countries (Germany, Austria, Switzerland) with different prices, currency or shippingYesGoogle's case of similar content with small regional variations in a single language
Only navigation and footer are translated, the product text is notYes, but fix the textGoogle counts localized versions as duplicates when the main content stays untranslated

Three facts from Google frame everything else:

  • Hreflang needs separate URLs. Google recommends different URLs for each language version instead of cookies or browser settings that change the language on one URL. Its product markup rules also ask for a distinct URL per currency when you sell in several currencies.
  • Hreflang does not detect or change language. Google says it does not use hreflang or the HTML lang attribute to detect the language of a page; it uses algorithms on the visible content.
  • Google may find the versions without help. It still says it is usually better to state them explicitly.

Hreflang is one part of an international product page. The guide to what search engines read on a product page covers the rest.

Where the versions live#

Google lists four URL structures for country and language versions, as of November 2026:

StructureExampleGoogle's remark
Country domainexample.deClear geotargeting; needs more infrastructure and targets one country only
Subdomainde.example.comEasy to set up; users may not recognize the targeting from the URL
Subdirectoryexample.com/de/Easy to set up, low maintenance on one host
URL parameterexample.com?loc=deNot recommended

Hreflang works across all of them: Google says alternate URLs do not need to be in the same domain. For the part of the URL after the folder, see how to write product URL slugs in each language.

The three ways to declare hreflang#

MethodWhere it goesUse it when
HTMLlink elements in the head of every versionYour shop templates can print the set on each page
HTTP headerA Link header in the responseThe file is not HTML, such as a PDF manual
XML sitemapxhtml:link entries under each URLYou cannot change templates, or you manage many URLs from one export

Google says the three methods are equivalent, and that using all of them at the same time brings no benefit in Search and makes the setup harder to manage. Pick one. The hreflang generator at the top of this page builds the HTML tags and the sitemap entries for your languages and countries and checks the codes.

Put one link element per version, including the page itself, into the head:

<link rel="alternate" hreflang="de-DE" href="https://www.northpeak.example/de-de/trail-400-stirnlampe" />
<link rel="alternate" hreflang="en-US" href="https://www.northpeak.example/en-us/trail-400-headlamp" />

Google requires the tags to sit inside a well-formed head, and says the set of links is identical for every version of the page. Do not combine hreflang with other alternate attributes such as media in the same tag.

HTTP header#

For non-HTML files, send the set in a Link header on the GET response. Each entry has the URL in angle brackets, then rel="alternate" and the hreflang value; entries are separated by commas. This is one header, wrapped here for reading:

Link: <https://www.northpeak.example/de-de/trail-400-anleitung.pdf>; rel="alternate"; hreflang="de-DE",
      <https://www.northpeak.example/en-us/trail-400-manual.pdf>; rel="alternate"; hreflang="en-US"

XML sitemap#

Declare the xhtml namespace, give every version its own url element with a loc, and list every version, including itself, as xhtml:link children:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://www.northpeak.example/de-de/trail-400-stirnlampe</loc>
    <xhtml:link rel="alternate" hreflang="de-DE" href="https://www.northpeak.example/de-de/trail-400-stirnlampe"/>
    <xhtml:link rel="alternate" hreflang="en-US" href="https://www.northpeak.example/en-us/trail-400-headlamp"/>
  </url>
  <url>
    <loc>https://www.northpeak.example/en-us/trail-400-headlamp</loc>
    <xhtml:link rel="alternate" hreflang="de-DE" href="https://www.northpeak.example/de-de/trail-400-stirnlampe"/>
    <xhtml:link rel="alternate" hreflang="en-US" href="https://www.northpeak.example/en-us/trail-400-headlamp"/>
  </url>
</urlset>

Google adds that the order of the child elements does not matter and that they do not count toward the URL limit of a sitemap.

The codes: language first, region optional#

A value is a language code in ISO 639-1 format, optionally followed by a hyphen and a region code in ISO 3166-1 alpha-2 format. The HTML Standard only asks for a valid BCP 47 language tag; Google supports this narrower set.

ValueWorks on Google?What it means or what is wrong
deYesGerman, independent of region
en-GBYesEnglish for users in the United Kingdom
de-CHYesGerman for users in Switzerland
de-ESYesGerman for users in Spain (Google's own example)
zh-HantYesA script variation; Google also derives the script from the country, as in zh-TW
en-UKNo effectUK is a reserved code, not the ISO code; write en-GB
en-EUNo effectEU is a reserved code, not a country
be for BelgiumWrong targetThe first code is always a language, and be is Belarusian
es-419Not supportedCodes outside the two ISO lists are not supported
x-defaultYesReserved value for the fallback page

Two rules catch most wrong codes. First, the language always comes first, and a region alone is not valid: Google does not derive the language from a country code. Second, the region is the ISO country code, which is not always the abbreviation people use.

Google gives the same rules for all three methods:

  1. Self-reference. Each language version must list itself as well as all other language versions.
  2. Return links. If page X links to page Y, page Y must link back to page X. Google states: "If two pages don't both point to each other, the tags will be ignored."
  3. Full URLs. Alternate URLs must be fully qualified, including https://.
  4. A catchall per language. If you have several URLs for one language in different countries, Google advises a catchall URL for users of that language elsewhere, and says it can be one of the specific pages.
  5. A fallback. Google recommends x-default for the page that users get when their language settings match none of your versions. It needs no language code. Google designed it for language selector pages but says you can use it for any page.

You do not have to translate every product for every market. Google only says that newly added language pages should link in both directions with the original or dominant language version. A product you do not sell in Switzerland has no Swiss URL, so its set has no de-CH entry.

Canonical and hreflang together#

The two annotations answer different questions: canonical says which URL represents a group of duplicates, hreflang says which URLs are versions for other audiences. Google's canonical documentation gives four rules for using them together:

  • If you use hreflang, specify a canonical page in the same language, or the closest substitute language if none exists. A German page whose canonical points to the English page contradicts its own hreflang set.
  • Link annotations with hreflang are not used for canonicalization. Use rel="alternate" with hreflang for language and country versions, and rel="canonical" only for duplicates.
  • Use the HTTPS URLs in hreflang annotations, not the HTTP versions.
  • Google prefers URLs that are part of an hreflang cluster when it picks a canonical. In its example, German pages for Germany and Switzerland that reference each other are preferred over an Austrian page that is left out.

When the same text really is published twice for the same audience (Google's example is example.de/ and example.com/de/), Google's advice is to pick a preferred version with rel="canonical". Product texts copied across a catalog are a separate problem; see when duplicate product descriptions hurt.

Worked example: one headlamp, five markets#

Northpeak sells the Trail 400 headlamp in Germany, Austria, Switzerland, the United Kingdom and the United States.

MarketValueURL pathWhat differs on the page
Germanyde-DE/de-de/trail-400-stirnlampePrice in EUR, shipping within Germany
Austriade-AT/de-at/trail-400-stirnlampePrice in EUR, shipping to Austria
Switzerlandde-CH/de-ch/trail-400-stirnlampePrice in CHF, customs and shipping to Switzerland
United Kingdomen-GB/en-gb/trail-400-head-torchPrice in GBP, British wording ("head torch")
United Statesen-US/en-us/trail-400-headlampPrice in USD

Northpeak adds two catchalls and a fallback: de for German speakers elsewhere (the German page), en for English speakers elsewhere (the US page) and x-default for everyone else (also the US page). The same eight lines go into the head of all five pages:

<link rel="alternate" hreflang="de-DE" href="https://www.northpeak.example/de-de/trail-400-stirnlampe" />
<link rel="alternate" hreflang="de-AT" href="https://www.northpeak.example/de-at/trail-400-stirnlampe" />
<link rel="alternate" hreflang="de-CH" href="https://www.northpeak.example/de-ch/trail-400-stirnlampe" />
<link rel="alternate" hreflang="de" href="https://www.northpeak.example/de-de/trail-400-stirnlampe" />
<link rel="alternate" hreflang="en-GB" href="https://www.northpeak.example/en-gb/trail-400-head-torch" />
<link rel="alternate" hreflang="en-US" href="https://www.northpeak.example/en-us/trail-400-headlamp" />
<link rel="alternate" hreflang="en" href="https://www.northpeak.example/en-us/trail-400-headlamp" />
<link rel="alternate" hreflang="x-default" href="https://www.northpeak.example/en-us/trail-400-headlamp" />

Each page also carries a canonical that points to itself, which marks every regional page as a page of its own. The set asks Google to show the Austrian page to a German speaker in Austria, the de catchall to a German speaker in Belgium, the en catchall to an English speaker in Australia, and the fallback to a French speaker.

Three related jobs follow from the same table. Each version needs its own title and meta description in its language, within the length that search results show. Each version needs its own Product structured data with its own price and currency. And each version needs text written for that market; the guide to writing product descriptions shows how to work from facts.

The mistakes Google lists#

Google's page names three common mistakes. The rows below them come from other rules in Google's documentation.

MistakeWhat Google saysFix
Missing return linksAnnotations may be ignored or not interpreted correctlyBuild the set once per product and print the same set on every version
Incorrect language codesCodes must be ISO 639-1, plus optionally an ISO 3166-1 alpha-2 region; a region alone is not validCheck every value against the two lists
Incorrect region codesReserved codes such as EU, UN or UK have no effecten-GB, not en-UK
Relative URLsAlternate URLs must be fully qualifiedWrite https:// and the host in every href
Tags outside the headThe tags must be inside a well-formed headCheck the rendered HTML in a validator, as Google suggests
Canonical in another languageThe canonical should be in the same languagePoint each version's canonical at itself
HTTP URLs on an HTTPS shopDo not include HTTP versions in hreflang annotationsUse the HTTPS URLs
Automatic redirects by assumed languageGoogle says to avoid them: they can keep users and search engines from seeing all versionsShow a link to the other versions instead

The last row matters for crawling. Google says its crawler usually originates from the USA and sends requests without an Accept-Language header. A shop that redirects by location or browser language may never show Google its other versions.

How to test#

Search Console no longer has a report for this. Google's help page says the International Targeting report has been deprecated, and that Google will continue to support and use hreflang tags. Google's documentation names two third-party checkers and adds that they are not maintained or checked by Google. What remains is a check against the rules:

  1. Open the source of each version and confirm that the link elements are inside the head.
  2. Compare the sets: every version lists the same URLs, including itself.
  3. Confirm that every href is a full HTTPS URL.
  4. Check each value: language first, ISO region second, x-default at most as a fallback. The hreflang generator flags codes that are not valid.
  5. Confirm that each version's canonical is a page in the same language.
  6. For sitemaps, confirm the xhtml namespace and that every url element has a loc and the full list of versions.

Does Bing use hreflang?#

Bing says to use it, but documents far less than Google. In a webmaster blog post of December 19, 2025, Bing writes "Use hreflang to define language and regional targeting" and shows a link element with hreflang="en-gb". The post lists hreflang next to canonical tags, redirects, noindex and IndexNow as signals that make clear which version to show.

The same post warns that localization creates duplicate content when regional or language pages are nearly identical. Bing's advice is to localize with meaningful changes such as terminology, examples, regulations or product details, and to keep separate pages only when the intent changes; it names localized pricing as such a case.

Bing's Webmaster Guidelines, as read on November 23, 2026, do not mention hreflang. Neither source lists supported codes, x-default or a sitemap syntax. The annotations you build for Google are what Bing's post asks for.

Where Central helps#

Hreflang connects the versions of a product page; it does not make their content right. Central researches the product data a listing needs from your own data, the open web and verified databases, backs every value with sources you can check and holds back what the sources do not support. It writes titles, descriptions and attributes from that record and flags texts when a fact behind them changes, so you can see which versions of a product page need an update.

See it on your own products

Questions

What is hreflang?

Hreflang is an attribute that names the language, and optionally the country, of an alternate version of a page. A set of hreflang annotations tells Google which URL to show to a searcher in a given language or region.

Does a shop with one language and one country need hreflang?

No. Hreflang connects versions of the same page. If each product has only one page, there is nothing to connect.

Is en-UK a valid hreflang value?

No. The ISO 3166-1 alpha-2 code for the United Kingdom is GB, so the value is en-GB. Google says that reserved codes such as EU, UN or UK have no effect on Google Search.

What does x-default do?

x-default is a reserved value for the fallback page. Google uses it when no other language or region in the set matches the searcher's browser setting. Google designed it for language selector pages, but says you can use it for any page.

Does Bing use hreflang?

Bing's webmaster blog of December 19, 2025 says to use hreflang to define language and regional targeting. Bing's Webmaster Guidelines, as read on November 23, 2026, do not mention hreflang, and Bing publishes no list of supported codes.

Sources

  1. Tell Google about localized versions of your pageGoogle Search Centralchecked 23 November 2026
  2. Managing multi-regional and multilingual sitesGoogle Search Centralchecked 23 November 2026
  3. How to specify a canonical URL with rel="canonical" and other methodsGoogle Search Centralchecked 23 November 2026
  4. The International Targeting report is deprecatedSearch Console Helpchecked 23 November 2026
  5. Merchant listing (Product, Offer) structured dataGoogle Search Centralchecked 23 November 2026
  6. Does Duplicate Content Hurt SEO and AI Search Visibility?Bing Webmaster Blogchecked 23 November 2026
  7. Bing Webmaster GuidelinesMicrosoft Bingchecked 23 November 2026
  8. HTML Standard: LinksWHATWGchecked 23 November 2026

More on this topic

Product pages and SEO

You choose what goes in and where it goes out.

Central AI does everything in between. Your first 3 products are free.

  1. Your inputYour shop, your files or your product pages.
  2. Central AIResearches, verifies and writes everything in between. Every value is backed by sources you can check; what the sources do not support is held back.
  3. Your channelsProduct data and listings for the channels you choose.