What is Hreflang
Hreflang is an HTML link attribute <link rel="alternate" hreflang="xx" href="..."> that tells search engines about a page's language and regional versions. Google introduced the attribute in 2011 to address an issue with multilingual sites.
Without hreflang, Google may show French users the German version of a page or mix up versions for different regions. Hreflang addresses this by explicitly specifying which version is intended for which audience.
Important: Yandex also supports hreflang, although it uses it less strictly than Google.
Why Hreflang is needed
Hreflang is needed in the following cases:
- Multiple languages — the site is available in Russian, English, German, etc.
- Regional variants — one language for different countries (en-US, en-GB, en-AU)
- Same content — pages with similar content for different audiences
Without properly configured hreflang:
- The search engine shows the wrong language version
- Traffic from target regions is lost
- Pages compete with each other in search results
How to configure Hreflang
Add the following to the <head> of each language version of the page:
<link rel="alternate" hreflang="ru" href="https://example.com/ru/page" />
<link rel="alternate" hreflang="en" href="https://example.com/en/page" />
<link rel="alternate" hreflang="en-US" href="https://example.com/us/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page" />Key rules
- Reciprocal links — each version must link to all the other versions, including itself
- x-default — specifies the default version when there is no match for the region/language
- Absolute URLs — always use full URLs with the protocol
- Language codes according to ISO 639-1 — ru, en, de, fr, etc.
- Region codes according to ISO 3166-1 — US, GB, RU, DE, etc.
Implementation options
Hreflang can be added in three ways:
1. HTML tag in the head (most common):
<link rel="alternate" hreflang="ru" href="https://example.com/ru/" />2. HTTP header (for PDFs and non-HTML pages):
Link: <https://example.com/ru/>; rel="alternate"; hreflang="ru"
3. XML Sitemap:
<url>
<loc>https://example.com/page</loc>
<xhtml:link rel="alternate" hreflang="ru" href="https://example.com/ru/page"/>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/page"/>
</url>Check Hreflang with reChecker
Use the Hreflang Checker to fully check your site's multilingual markup. The tool will show:
- A list of all hreflang tags on the page
- Errors in language and region codes
- Missing reciprocal links
- Conflicts between HTML tags and the Sitemap
FAQ
How many language versions can be specified? There is no technical limit. You can specify dozens of versions — Google will process them all. The important thing is that each version links to all the others.
Does Hreflang work for subdomains?
Yes, hreflang works for subdirectories (example.com/ru/), subdomains (ru.example.com), and ccTLDs (example.ru). The URL structure does not affect how the attribute works.
Why is Google ignoring my hreflang? The most common reasons are missing reciprocal links (page A does not link to B), incorrect language/region codes, and mismatched URLs in the Sitemap and HTML tags. Check all versions with reChecker.