Hreflang is an HTML attribute that tells search engines which language and regional version of a page to show to users in different countries or speaking different languages. It prevents duplicate content issues on multilingual sites and ensures that Google, Bing, and other search engines serve the right version of your page to the right audience.
How Hreflang Works
You place link elements with the hreflang attribute in the <head> section of each page. Each tag points to an alternate language version of the same content:
<link rel="alternate" hreflang="en" href="https://example.com/en/about/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/ueber-uns/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/about/" />
The x-default Value
The special value x-default designates the fallback page for users whose language or region does not match any of the specified hreflang values. Typically, this points to your primary language version or a language-selection page.
Common Hreflang Formats
en— English (any region)de— German (any region)en-US— English for the United Statesde-AT— German for Austriapt-BR— Portuguese for Brazil
Why Hreflang is Important for SEO
- Avoids duplicate content penalties — Search engines understand that /en/about/ and /de/ueber-uns/ are the same content in different languages, not duplicates.
- Improves user experience — Users see search results in their language.
- Increases regional rankings — Pages with correct hreflang tags rank better in local search results.
- Reduces bounce rate — Visitors who land on a page in their language are more likely to stay.
Common Mistakes
- Missing return links — If page A links to page B via hreflang, page B must also link back to page A. This is called bidirectional confirmation.
- Wrong language codes — Using
ukinstead ofen-GBfor British English, orjpinstead ofjafor Japanese. - Missing x-default — Without a fallback, search engines may pick the wrong version for unmatched users.
- Non-canonical URLs in hreflang — The href in hreflang tags must point to the canonical version of each page.
How InspectWP Helps
InspectWP detects all hreflang tags on your WordPress site and lists each language variant found. This helps you verify that all language versions are correctly linked and that no return links are missing.