Skip to main content
SEO

Hreflang

Published:
Updated:

Hreflang is the attribute in a <link rel="alternate" hreflang="…"> annotation that declares the same content exists in several language or regional versions and states which version is for whom. It can be delivered three ways: link tags in the <head>, an HTTP Link header (for non-HTML files such as PDFs), or entries in an XML sitemap. Pick one delivery method and apply it consistently.

For Google, use supported ISO 639-1 language codes and optional ISO 3166-1 Alpha 2 regions, such as pl, en-GB and pt-BR; its documentation also covers script variants. Not every valid BCP 47 tag is a supported Google hreflang value. A region alone, such as GB, is insufficient.

Self referencing hreflang

Each version should declare itself and the other versions. A missing self-reference is an annotation gap to fix; it is not proof that Google discarded the entire cluster.

This is the most common mistake: teams declare only the "other" versions, assuming the current one is implied. It is not — the annotations describe the whole cluster, not a one-way "from here to there" relation.

Complete set in the <head> of the Polish page
HTML
<link rel="alternate" hreflang="pl" href="https://example.com/pl/cennik">
<link rel="alternate" hreflang="en" href="https://example.com/pricing">
<link rel="alternate" hreflang="de" href="https://example.com/de/preise">
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing">

Return tags

Annotations must be reciprocal. If page A names B as its English version, B must name A back as the Polish version. A missing return tag makes the declaration one-sided, and it is dropped.

Reciprocity is a safeguard against hijacking: without it any domain could declare itself a language version of somebody else’s page.

HTTP status, indexability and canonical

Check separately: absolute URL, HTTP 200 response, absence of noindex, crawl access, canonical alignment and return annotation. A noindex page can return 200. A redirect or 404 is different from an indexing exclusion; assess specific relationships without assuming the entire set failed.

Hreflang URLs also need to agree with your canonicals. Each language version should self-canonicalize; canonicalizing language versions onto a single URL defeats the purpose of hreflang.

x-default

x-default names the page for users whose language or region matches none of the declared versions — typically a language selector or an international edition. It is optional, but useful once you run several regional versions of one language.

What hreflang does not do

Hreflang is not a ranking signal and will not lift positions. It also does not consolidate signals across versions the way a canonical does — each version ranks on its own. Its only job is to swap the result for the version that suits the audience.

Hreflang does not force indexing either. A noindex page will not start being indexed because an annotation points at it.

How to verify hreflang today

Collect annotations from HTML, headers or sitemaps and compare both sides of each language pair using a crawler or manual inspection. URL Inspection helps check fetching, indexing and canonical selection; it is not a dedicated hreflang validator.

Variant for non-HTML files
HTTP
Link: <https://example.com/pl/raport.pdf>; rel="alternate"; hreflang="pl",
      <https://example.com/report.pdf>; rel="alternate"; hreflang="en"

Sources & further reading

Check your site’s language versions

Insight analyses public SEO signals including hreflang, canonicals, sitemap and HTTP statuses, then orders findings by priority.