patternjavascriptMajor
hreflang for multilingual and multi-regional SEO
Viewed 0 times
hreflangmultilingual seointernational seolocalex-defaultlanguage targeting
Problem
Sites serving the same content in multiple languages or for multiple regions without hreflang tags suffer from duplicate content issues and content being served to the wrong locale — e.g., the French version ranking for English queries.
Solution
Add hreflang link elements in <head> for every language/region variant of each page. Each page must list all of its variants including itself. Use a x-default hreflang to designate the fallback for unmatched locales.
Why
hreflang tells Google which language/locale a page targets and which pages are equivalent variants. Without it, Google may canonicalize one version and suppress the others from local SERPs.
Gotchas
- hreflang is bidirectional — if page A lists page B, page B must also list page A, or Google ignores the annotation
- Use BCP 47 language codes (e.g., en-US, fr-FR, pt-BR) — ISO 639-1 language codes alone (en, fr) also work
- hreflang can also be implemented in sitemap.xml or HTTP headers (useful for PDFs)
- x-default should point to a selector page or the most globally relevant version
Code Snippets
hreflang link tags for a multilingual page
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/page" />
<link rel="alternate" hreflang="fr-FR" href="https://example.com/fr-fr/page" />
<link rel="alternate" hreflang="de-DE" href="https://example.com/de-de/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page" />Context
Sites serving content in multiple languages or targeting users in different countries
Revisions (0)
No revisions yet.