What is hreflang?
Hreflang is an attribute that tells search engines which language, and optionally which region, a page is meant for, and where alternate versions exist. It helps show the right version to the right user.
Last reviewed .
When to use hreflang
Use it when you have the same or similar content in multiple languages, or for several regions that share a language, such as English pages for the US and the UK. It points search engines to the right version for each searcher.
Sites with a single language and audience don't need it.
How to set it up
You can add hreflang annotations in the HTML head, in HTTP headers, or in an XML sitemap. Each version of a page must list all versions, including itself, and every page listed must link back.
Use valid language codes, with an optional region code, and, optionally, an "x-default" entry for visitors who match none.
Common mistakes
Missing return links, wrong codes, and pointing to pages that redirect or are blocked are frequent errors. Any of them can cause search engines to ignore the annotations.
Common questions
Does hreflang improve rankings?
Not directly. It helps search engines show the correct language or regional version, which can improve the experience and reduce competition between your own pages.
What is x-default in hreflang?
It's a fallback value for users whose language or region doesn't match any version you have. It usually points to a language selector or a general page.
Is hreflang the same as a canonical tag?
No. Hreflang links equivalent pages in different languages or regions. A canonical tag names the preferred URL among duplicates. They often work together and should not contradict each other.
Does Google need hreflang to detect language?
Google can usually detect a page's language from its content. Hreflang helps with matching the right version to the right audience, especially for similar pages.
Want help putting this to work?
Tell us where your marketing stands today, and we'll show you what to do first.