// SEO plans from €35/hour or €395/month// from €35/hr · €395/mo Free SEO checker[email protected]+31 6 4555 9353
Free SEO audit
technical seo

Hreflang Tags: A Complete Guide for Multilingual Sites

Hreflang annotations tell Google that several pages are language or regional versions of the same content, so Search can show each user the most suitable one. This guide covers when to use them, the three methods, the rules, language and region codes, x-default, common mistakes and testing.

  • Three methods
  • Reciprocal rules
  • Valid codes
  • x-default
htmlhreflang
<link rel="alternate" hreflang="en-gb"
  href="https://example.com/uk/">
<link rel="alternate" hreflang="x-default"
  href="https://example.com/">
// quick answer
Add hreflang with one of three equivalent methods: HTML link tags, an HTTP Link header, or an XML sitemap. Every version must list itself and every other version, with fully qualified URLs, and pages must link back to each other, or Google ignores the tags. Use a two-letter ISO 639-1 language code, optionally with an ISO 3166-1 Alpha-2 region, and consider an x-default fallback.

When to use hreflang

  • Template-only translation: main content stays in one language; only navigation and footer are translated.
  • Small regional differences: similar content aimed at different countries, such as English for the US, UK and Ireland.
  • Full translation: every page exists in several languages.

Google may find alternates without annotations, but explicit ones are usually better. Translated pages count as duplicates only when their main content is not translated.

The three methods

MethodNotes per Google
HTML link tags in headEach variant carries the same set of links, including one to itself
HTTP Link headerUseful for non-HTML files such as PDFs; identical across all versions
XML sitemapEach url entry lists all variants with xhtml:link; declare the xhtml namespace

Google treats them as equivalent; using more than one gives no search benefit and makes maintenance harder. See sitemaps.

Rules for all methods

selfEach version lists itself and every other version
URLsFully qualified, with protocol; not root-relative
returnIf pages do not link back to each other, Google ignores the tags
domainsAlternates can be on different domains
partialYou may omit some languages; reciprocal pairs are still processed
<link rel="alternate" hreflang="en" href="https://example.com/en/">
<link rel="alternate" hreflang="de" href="https://example.com/de/">

The snippet is an illustration of the pattern: both pages carry both lines.

Language and region codes

ItemRule
LanguageTwo-letter ISO 639-1 required
RegionOptional ISO 3166-1 Alpha-2 after a dash, such as en-GB
ScriptsISO 15924 supported, such as zh-Hant
Region onlyInvalid; Google does not infer language from a country
Reserved codesEU, UN, UK ignored; GB is correct for the United Kingdom
CaseCase-insensitive

x-default

It marks the fallback page for users whose language settings match none of your versions. It takes no language code, is designed for language selector pages but can be used on any page, and is added as one more link alongside the others. When several locales share a language, provide a generic page for that language.

Implement step by step

1
map

Map equivalent pages

One row per page, per language.

map
2
codes

Choose valid codes

Language plus optional region.

codes
3
method

Pick one method

HTML, header or sitemap.

method
4
full set

List all versions

Including itself.

self
5
default

Add x-default

For a selector or home.

x-default
6
test

Validate

Check return links.

validate

What Google does with hreflang

  • It uses annotations to understand pages are variants of the same content and picks the variant based on browser language settings.
  • It does not rely on hreflang or the HTML lang attribute to detect a page’s language.
  • It ignores non-reciprocal tags and invalid or reserved codes, but still processes the valid parts.
  • Canonical pages should match the language, or the closest substitute (canonicals).

Notes for WordPress sites

  • Multilingual plugins often output hreflang automatically; check the page source (my own note).
  • One method only: avoid plugin tags plus sitemap duplicates.
  • Language switcher links should be real anchors (crawlable links).
  • Translations: translate main content, not just templates.

Troubleshooting

SymptomLikely cause (my own diagnosis)Action
Wrong version shownMissing return links or bad codesValidate set
Tags ignoredNot reciprocalAdd return links
UK version not matchingUsed UK, not GBUse en-GB
Canonical conflictsCanonical points to another languageSelf-canonical per version

Checklist

Set

  • Self-reference
  • All versions listed
  • Return links
  • Absolute URLs

Codes

  • ISO 639-1 language
  • Valid region
  • No UK or EU
  • x-default decided

Method

  • One method
  • Consistent output
  • Sitemap namespace
  • Header for PDFs

Test

  • Spot-check pages
  • Canonicals match
  • Tool validation
  • Recheck after changes

What Google’s page does not say

It does not say whether hreflang directly affects rankings or only which variant is shown, any maximum number of alternates, how errors are reported in Search Console, how long changes take, trailing slash normalisation effects, or how conflicting entries are handled. Third-party validators exist but Google does not maintain or verify them.

Key terms

hreflang
Language and region annotation.
x-default
Fallback version.
Reciprocal
Pages link back to each other.
ISO 639-1
Two-letter language codes.

Common mistakes

mistake 1

Missing return links

Tags ignored.

Link both ways.
mistake 2

Region-only codes

Invalid.

Add the language.
mistake 3

Using UK

Reserved, ignored.

Use GB.
mistake 4

Relative URLs

Not acceptable.

Use full URLs.
mistake 5

Multiple methods

No benefit, harder upkeep.

Pick one.
mistake 6

Untranslated pages

Count as duplicates.

Translate main content.

Related guides

faq

Hreflang questions

Do I need hreflang?

Google may find alternates anyway, but explicit annotations are usually better.

Which method is best?

Google treats all three as equivalent.

Must pages link back?

Yes; otherwise Google ignores the tags.

Can I use a country code alone?

No; the language is required.

Is es-419 supported?

Google says non-standard codes like es-419 are not supported.

What is x-default?

The fallback page for users matching no version.

Does hreflang boost rankings?

Google’s page does not say.

Does Google use the lang attribute?

No, it uses its own algorithms to detect language.

sources

Methods, rules, codes, x-default and mistakes come from Google’s page. The step plan, WordPress notes, troubleshooting and checklists are my own.

Scroll to Top