# 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.

Source: https://central.to/guides/hreflang-for-online-shops · Updated 2026-11-23 · Published by Central (https://central.to)

## 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.

Free tool: [Hreflang generator](https://central.to/tools/hreflang-generator). Build hreflang tags and sitemap entries for a shop in several languages and countries, with the codes checked.

## 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](https://developers.google.com/search/docs/specialty/international/localized-versions)).

| Your shop | Hreflang? | Why |
| --- | --- | --- |
| One language, one country | No | Each product has one page; there is nothing to connect |
| The same products in German and in English | Yes | Google'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 shipping | Yes | Google's case of similar content with small regional variations in a single language |
| Only navigation and footer are translated, the product text is not | Yes, but fix the text | Google 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](https://central.to/guides/product-page-seo) covers the rest.

### Where the versions live

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

| Structure | Example | Google's remark |
| --- | --- | --- |
| Country domain | `example.de` | Clear geotargeting; needs more infrastructure and targets one country only |
| Subdomain | `de.example.com` | Easy to set up; users may not recognize the targeting from the URL |
| Subdirectory | `example.com/de/` | Easy to set up, low maintenance on one host |
| URL parameter | `example.com?loc=de` | Not 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](https://central.to/guides/url-slugs-for-product-pages) in each language.

## The three ways to declare hreflang

| Method | Where it goes | Use it when |
| --- | --- | --- |
| HTML | `link` elements in the `head` of every version | Your shop templates can print the set on each page |
| HTTP header | A `Link` header in the response | The file is not HTML, such as a PDF manual |
| XML sitemap | `xhtml:link` entries under each URL | You 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](https://central.to/tools/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.

### HTML link elements

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

```html
<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
<?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.

| Value | Works on Google? | What it means or what is wrong |
| --- | --- | --- |
| `de` | Yes | German, independent of region |
| `en-GB` | Yes | English for users in the United Kingdom |
| `de-CH` | Yes | German for users in Switzerland |
| `de-ES` | Yes | German for users in Spain (Google's own example) |
| `zh-Hant` | Yes | A script variation; Google also derives the script from the country, as in `zh-TW` |
| `en-UK` | No effect | UK is a reserved code, not the ISO code; write `en-GB` |
| `en-EU` | No effect | EU is a reserved code, not a country |
| `be` for Belgium | Wrong target | The first code is always a language, and `be` is Belarusian |
| `es-419` | Not supported | Codes outside the two ISO lists are not supported |
| `x-default` | Yes | Reserved 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.

## Return links, self-reference and x-default

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](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls) 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](https://central.to/guides/duplicate-product-descriptions).

## Worked example: one headlamp, five markets

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

| Market | Value | URL path | What differs on the page |
| --- | --- | --- | --- |
| Germany | `de-DE` | `/de-de/trail-400-stirnlampe` | Price in EUR, shipping within Germany |
| Austria | `de-AT` | `/de-at/trail-400-stirnlampe` | Price in EUR, shipping to Austria |
| Switzerland | `de-CH` | `/de-ch/trail-400-stirnlampe` | Price in CHF, customs and shipping to Switzerland |
| United Kingdom | `en-GB` | `/en-gb/trail-400-head-torch` | Price in GBP, British wording ("head torch") |
| United States | `en-US` | `/en-us/trail-400-headlamp` | Price 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:

```html
<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](https://central.to/guides/meta-title-and-description-length). Each version needs its own [Product structured data](https://central.to/guides/product-schema-markup) with its own price and currency. And each version needs text written for that market; the guide to [writing product descriptions](https://central.to/guides/how-to-write-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.

| Mistake | What Google says | Fix |
| --- | --- | --- |
| Missing return links | Annotations may be ignored or not interpreted correctly | Build the set once per product and print the same set on every version |
| Incorrect language codes | Codes must be ISO 639-1, plus optionally an ISO 3166-1 alpha-2 region; a region alone is not valid | Check every value against the two lists |
| Incorrect region codes | Reserved codes such as EU, UN or UK have no effect | `en-GB`, not `en-UK` |
| Relative URLs | Alternate URLs must be fully qualified | Write `https://` and the host in every `href` |
| Tags outside the head | The tags must be inside a well-formed `head` | Check the rendered HTML in a validator, as Google suggests |
| Canonical in another language | The canonical should be in the same language | Point each version's canonical at itself |
| HTTP URLs on an HTTPS shop | Do not include HTTP versions in hreflang annotations | Use the HTTPS URLs |
| Automatic redirects by assumed language | Google says to avoid them: they can keep users and search engines from seeing all versions | Show 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](https://blogs.bing.com/webmaster/December-2025/Does-Duplicate-Content-Hurt-SEO-and-AI-Search-Visibility), 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](https://www.bing.com/webmasters/help/webmaster-guidelines-30fba23a), 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.

## 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 page](https://developers.google.com/search/docs/specialty/international/localized-versions), checked 2026-11-23
2. [Managing multi-regional and multilingual sites](https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites), checked 2026-11-23
3. [How to specify a canonical URL with rel="canonical" and other methods](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls), checked 2026-11-23
4. [The International Targeting report is deprecated](https://support.google.com/webmasters/answer/12474899), checked 2026-11-23
5. [Merchant listing (Product, Offer) structured data](https://developers.google.com/search/docs/appearance/structured-data/merchant-listing), checked 2026-11-23
6. [Does Duplicate Content Hurt SEO and AI Search Visibility?](https://blogs.bing.com/webmaster/December-2025/Does-Duplicate-Content-Hurt-SEO-and-AI-Search-Visibility), checked 2026-11-23
7. [Bing Webmaster Guidelines](https://www.bing.com/webmasters/help/webmaster-guidelines-30fba23a), checked 2026-11-23
8. [HTML Standard: Links](https://html.spec.whatwg.org/multipage/links.html), checked 2026-11-23

## More on this topic: Product pages and SEO

- [Product page SEO: what search engines and AI assistants read](https://central.to/guides/product-page-seo.md)
- [How to write product descriptions: structure, examples and channel rules](https://central.to/guides/how-to-write-product-descriptions.md)
- [hreflang](https://central.to/glossary/hreflang.md)
- [JSON-LD](https://central.to/glossary/json-ld.md)
- [Meta title and description length for product pages](https://central.to/guides/meta-title-and-description-length.md)
- [Product description examples and a template you can copy](https://central.to/guides/product-description-examples.md)
- [Product page FAQ: which questions to answer, and FAQ schema](https://central.to/guides/product-page-faq.md)
- [Product schema markup: the structured data Google needs](https://central.to/guides/product-schema-markup.md)
- [Structured data](https://central.to/glossary/structured-data.md)
- [URL slug](https://central.to/glossary/url-slug.md)
- [URL slugs for product pages: how to write SEO-friendly URLs](https://central.to/guides/url-slugs-for-product-pages.md)
- [Product description writer](https://central.to/tools/product-description-writer.md) (Free tool)
- [Product FAQ writer](https://central.to/tools/product-faq-writer.md) (Free tool)
- [Search snippet preview](https://central.to/tools/search-snippet-preview.md) (Free tool)
- [Slug and file name generator](https://central.to/tools/slug-generator.md) (Free tool)
- [Hreflang generator](https://central.to/tools/hreflang-generator.md) (Free tool)
- [Product schema checker](https://central.to/tools/product-schema-checker.md) (Free tool)
- [Product page checker](https://central.to/tools/product-page-checker.md) (Free tool)
- [Duplicate description finder](https://central.to/tools/duplicate-description-finder.md) (Free tool)

## Try Central on your own products

Central is the AI-first product content operating system: you choose the input (your shop, files or product pages) and the channels; Central AI researches, verifies and writes the product data and content in between, every value backed by sources you can check. The first 3 products are free. To start with a shop, open https://central.to/users/sign_up?onboarding_url=SHOP_ADDRESS (replace SHOP_ADDRESS with the shop's website address).
