# Hreflang (language and country versions of a page)

> What hreflang means, one example tag, the three places Google reads it from, what a valid value looks like and what hreflang does not do for a shop.

Source: https://central.to/glossary/hreflang · Updated 2026-11-23 · Published by Central (https://central.to)

**Definition:** Hreflang is an attribute that names the language, and optionally the country, of an alternate version of a page, so that search engines can show each searcher the version made for them.

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.

## What it means in practice

A shop that sells the same product in German and in English, or in Germany and in Switzerland, has several URLs for one product. Hreflang is how each of those pages names the others. Google asks for these annotations because they help it "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)).

In the [HTML Standard](https://html.spec.whatwg.org/multipage/links.html), `hreflang` is an attribute of a link that gives the language of the linked resource. Together with `rel="alternate"`, a different language there means that the linked document is a translation.

## One example tag

```html
<link rel="alternate" hreflang="de-CH" href="https://www.northpeak.example/de-ch/trail-400-stirnlampe" />
```

The line says: the German version for users in Switzerland is at this URL. The value is a language code (ISO 639-1), optionally followed by a region code (ISO 3166-1 alpha-2). The language always comes first; Google says a region alone is not valid. The reserved value `x-default` marks the fallback page for searchers whose language settings match none of the versions.

## The three places it can live

| Place | Form | Typical use |
| --- | --- | --- |
| HTML | `link` elements in the `head` | Product pages printed from a template |
| HTTP header | A `Link` header in the response | Files that are not HTML, such as PDFs |
| XML sitemap | `xhtml:link` entries under each URL | Large catalogs managed from an export |

Google treats the three as equivalent and says there is no benefit in Search to using more than one. In every form, each version lists itself and all other versions. Google states that if two pages do not both point to each other, the tags are ignored.

## What hreflang does not do

- **It does not translate.** It only connects pages that already exist. Google counts localized versions as duplicates when their main content stays untranslated.
- **It does not tell Google the language of a page.** Google says it does not use hreflang or the HTML `lang` attribute for that; it uses algorithms on the content.
- **It is not a canonical.** Google does not use link annotations with `hreflang` for canonicalization, and asks for a canonical page in the same language when you use hreflang.
- **It does not work one way.** A set without return links may be ignored or not interpreted correctly.
- **It is not a command to browsers.** The HTML Standard calls the attribute on hyperlinks purely advisory.

None of the sources above describes hreflang as a way to rank higher. What Google documents is the choice of which version of a page a searcher sees.

## What it means for a shop

Add hreflang once a product has more than one URL for language or country reasons, and build the set from one list per product so every version carries the same lines. The [hreflang generator](https://central.to/tools/hreflang-generator) builds the tags and sitemap entries and checks the codes. The guide to [hreflang for online shops](https://central.to/guides/hreflang-for-online-shops) shows the three methods with code, the valid and invalid codes, a worked example for five markets and the mistakes Google lists.

## Questions

### Is hreflang a tag or an attribute?

It is an attribute. People say hreflang tag for the whole link element that carries it: rel="alternate", the hreflang value and the URL of the other version.

### Does hreflang translate my page?

No. It only points to a version that already exists at another URL. Google says it does not even use hreflang to detect the language of a page; it reads the visible content.

### Which value is right for the United Kingdom?

en-GB. The region part is the ISO 3166-1 alpha-2 code, and Google says that reserved codes such as UK or EU have no effect.

## 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. [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
3. [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 for online shops: languages, countries and x-default](https://central.to/guides/hreflang-for-online-shops.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).
