What is hreflang?
Hreflang is an HTML attribute that specifies the language and optional regional targeting of a page, telling search engines which version to serve to users in different languages or locations.
What hreflang does
Hreflang annotations map alternate versions of a page to the languages and regions they serve, so a search engine can show a French speaker the French page and an American reader the US English page. It links equivalent pages together as a set of alternates.
This prevents users from landing on content in the wrong language and reduces the risk that similar translated pages are treated as duplicates. It is essential for any site serving multiple languages or country-specific variants.
How to implement hreflang
You can declare hreflang in three places: as link elements in the HTML head, as HTTP headers for non-HTML files, or within an XML sitemap. Each alternate page should reference every other alternate, including a self-reference, so the cluster is fully connected.
Values combine a language code with an optional region code, such as en for English or en-GB for British English. An x-default value can designate a fallback page for users whose language or region is not otherwise covered.
Common hreflang mistakes
Frequent errors include missing return links between alternates, using invalid or mismatched language and region codes, and pointing hreflang at URLs that redirect or return errors. Any of these can cause search engines to ignore the annotations.
Because hreflang must stay consistent across potentially hundreds of pages, it is easy to break at scale. Automated generation and regular validation help keep the alternate clusters accurate as a site grows.
Frequently asked questions
Is hreflang a ranking factor?
Hreflang is not a direct ranking factor, but it improves how the correct language and regional version of a page is served, which helps user experience and prevents duplicate-content confusion.
What is the x-default hreflang value?
The x-default value designates a fallback page that search engines serve to users whose language or region does not match any of the other specified hreflang alternates.
Keep reading
Want this machine pointed at your site?
This page is one of a swarm we generated for ourselves. We build the same for you.
Get Started - $10,000