hreflang
hreflang is an annotation that tells Google which pages are language or country versions of one page, so Search can show each searcher the right one.
How it works
A store that sells in several countries often has one product page in several versions: Czech, Slovak, Ukrainian. hreflang joins them into one set. Google uses the set to point each searcher to the version that matches their language or region.
Each version lists itself and every other version, with a language code and, if needed, a country code: cs, sk-SK, uk-UA. The reserved value x-default names the page for everyone else, such as a country selector.
The set can sit in <link rel="alternate" hreflang="…"> elements in the page head, in an HTTP header or in the XML sitemap; Google treats the three as equal. Addresses must be full, with https://, and may be on different domains. Links must go both ways: if the Slovak page doesn’t point back to the Czech one, Google ignores the pair. Each version needs a canonical URL in the same language.
Our guide to hreflang for a store in several countries covers domains and URL structure.
Example
Example store, not client data.
The tableware shop sells at example.cz in Czech and at example.sk in Slovak. Its blue mug lives at https://example.cz/hrnek-modry and https://example.sk/hrncek-modry. Both pages carry the same two lines:
<link rel="alternate" hreflang="cs" href="https://example.cz/hrnek-modry" />
<link rel="alternate" hreflang="sk" href="https://example.sk/hrncek-modry" />
With 3,000 products in both languages, that is 6,000 pages and 12,000 lines to keep in step.
Not to be confused with
- Content language — the language of product data in Merchant Center, set for each data source; Google shows those products to people who use that language. hreflang links pages of a website in Search.
Right and wrong readings
- Wrong:
hreflang="cz"on a Czech page. Right: the first code is always a language from ISO 639-1, and Czech iscs. CZ is a country code and can only follow it, as incs-CZ. - Wrong: “
hreflang="uk"targets the United Kingdom.” Right:ukis Ukrainian. British shoppers needen-GB; Google ignores UK as a region code. - Wrong: “hreflang tells Google the page language.” Right: Google detects the language itself; hreflang only links the versions.
Sources
- Tell Google about localized versions of your page — methods, return links, codes, x-default, language detection. Checked 2 October 2026.
- How to specify a canonical URL with rel=“canonical” and other methods — canonical in the same language. Checked 2 October 2026.
- ISO 639-2 code list (Library of Congress) —
csCzech,skSlovak,ukUkrainian. Checked 2 October 2026.