If your site serves the same content in multiple languages or to multiple regions, hreflang tells search engines which version to show to which audience. Without it, you risk the wrong language ranking, or pages competing with each other.
The syntax
Each version links to all others, including itself:
<link rel="alternate" hreflang="en-US" href="https://example.com/us/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />- Language is ISO 639-1 (
en,de,pt); you may add a region (en-US,pt-BR) x-defaultpoints to the fallback page for unmatched languages
The rules
- Reciprocal: if A links to B, B must link back to A
- Self-referencing: each page includes an hreflang pointing to itself
- Absolute URLs: always full
https://…links - One language per URL: do not serve two languages at the same URL
Hreflang is not canonical
Canonical says "this is the preferred URL for this content." Hreflang says "this is the same content in another language." Each language version should keep its own self-canonical while cross-linking with hreflang.
Choosing URL structure
- ccTLD (
example.de) — strongest geo signal, highest cost - Subdomain (
de.example.com) — clear separation - Subfolder (
example.com/de/) — easiest to manage; often best for small teams
Pick one and stay consistent. Hreflang works with all three.
Common mistakes
- Missing return links (the most frequent error)
- Using
hreflang="en"when you meant a specific region - Pointing at redirects instead of final URLs
- Forgetting
x-default - Emitting hreflang for pages that do not exist
How to validate
1. Use the hreflang generator to produce a consistent set.
2. Search Console → International targeting / Page indexing for hreflang errors.
3. Spot-check that every target URL returns 200 and is self-canonical.
Worked example
A three-language store on subfolders:
https://example.com/ → hreflang="x-default"
https://example.com/en/ → hreflang="en"
https://example.com/de/ → hreflang="de"
https://example.com/fr/ → hreflang="fr"Every page includes all four lines (including its own), and each page sets <link rel="canonical" href="<its own URL>">. That is the complete, reciprocal pattern.
Generate the block
List each language and URL in the free hreflang generator to get a clean, reciprocal set of tags. There are framework-specific versions for WordPress and Next.js.