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.
On this page
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.
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).
In the HTML Standard, 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#
<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
langattribute for that; it uses algorithms on the content. - It is not a canonical. Google does not use link annotations with
hreflangfor 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 builds the tags and sitemap entries and checks the codes. The guide to 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
- Tell Google about localized versions of your pageGoogle Search Centralchecked 23 November 2026
- How to specify a canonical URL with rel="canonical" and other methodsGoogle Search Centralchecked 23 November 2026
- HTML Standard: LinksWHATWGchecked 23 November 2026
- How to write product descriptions: structure, examples and channel rulesGuides
- JSON-LDGlossary
- Meta title and description length for product pagesGuides
- Product description examples and a template you can copyGuides
- Product page FAQ: which questions to answer, and FAQ schemaGuides
- Product schema markup: the structured data Google needsGuides
- Structured dataGlossary
- URL slugs for product pages: how to write SEO-friendly URLsGuides