Key Takeaways
- The hreflang attribute helps indicate to Google the language and regional targeting of pages, improving search relevance.
- Proper hreflang setup prevents duplication issues and enhances user behavioral factors.
- hreflang tags must be reciprocal — i.e., there should be bi-directional linking between language versions.
- The attribute can be implemented in various ways: within HTML, HTTP headers, and XML sitemaps.
- Using the hreflang x-default tag helps optimize which default site version is shown for unspecified languages or regions.
- Regular checks and monitoring of hreflang are essential during large-scale website updates.
The hreflang attribute is an HTML attribute that allows you to specify to search engines the language and regional targeting of a specific page version. Simply put, it tells Google which page to show the user based on their language and geography. Misconfigurations in hreflang can be costly: incorrect page versions can lead to content duplication issues, inaccurate geotargeting, and decreased click-through rates (CTR). Understanding and correctly implementing this attribute is key to a successful international SEO strategy.
You can learn more about Google’s official recommendations for hreflang in their documentation. Below, we explain how hreflang works in practice and what we pay attention to when conducting a technical website audit.
How Google Uses hreflang
Google analyzes the hreflang attribute to select the most relevant version of a site for search results. When a site has versions in multiple languages or for different regions, the search engine relies on this attribute:
<link rel="alternate" hreflang="en" href="https://site.com/en/" />
<link rel="alternate" hreflang="uk" href="https://site.com/uk/" />
<link rel="alternate" hreflang="x-default" href="https://site.com/" />
Here, rel="alternate" indicates these are alternative versions of the page, and hreflang="en" denotes the language and regional code (English). Using these tags, Google decides which version to display to a specific user, enhancing the quality of search results and user experience.
The Principle of Reciprocal Links
It is crucial to understand that hreflang tags must operate on the principle of bi-directional links. If page A references page B with hreflang, page B must also link back to page A using the corresponding hreflang tags.
If this is not done, Google may become confused and fail to recognize the correct page versions, leading to errors and reduced SEO effectiveness.
Example of correctly configured reciprocal links:
<link rel="alternate" hreflang="en" href="https://site.com/en/" />
<link rel="alternate" hreflang="uk" href="https://site.com/uk/" />
<link rel="alternate" hreflang="x-default" href="https://site.com/" />
<link rel="alternate" hreflang="en" href="https://site.com/en/" />
<link rel="alternate" hreflang="uk" href="https://site.com/uk/" />
<link rel="alternate" hreflang="x-default" href="https://site.com/" />
If any of these tags are missing, this results in so-called “asymmetric” linking, which Google interprets as an error.
What is x-default and Why is it Needed?
The hreflang="x-default" tag indicates to search engines a fallback (default) version of the page — the version shown to users whose language or region does not match any of the localized site versions. Simply put, this acts as insurance against uncertainty: if Google can’t determine which version to display, it will select the one marked as x-default.
Common uses of x-default include:
- The homepage, where users choose their language or country
- International websites where the default content is in a single language (e.g., English)
- Situations where traffic should be directed to a universal version not tied to a specific region
Example setup:
<link rel="alternate" hreflang="en" href="https://site.com/en/" />
<link rel="alternate" hreflang="uk" href="https://site.com/uk/" />
<link rel="alternate" hreflang="x-default" href="https://site.com/" />
Important: x-default does not replace other language versions but complements them, helping Google avoid choosing the wrong page version. Without this tag, users with unrecognized languages might land on an arbitrary localization, often resulting in high bounce rates and loss of conversions.
When and Why You Need hreflang
Multilingual and multi-regional websites often wonder if hreflang is necessary. Let’s look at when it is a must-have and when its impact is minimal.
Scenarios Where hreflang is Essential
- Sites with multiple languages — basic versions targeting different countries, e.g., English and German versions of a site
- Multi-domain structure — using different domains or ccTLDs (.com, .ua, .pl) for different countries
- Regional language variations — e.g., English for the US (en-US) and UK (en-GB), French for Canada (fr-CA) and France (fr-FR), where content and localization differ
In these cases, hreflang improves SEO quality, helps avoid duplication issues, and enhances user experience.
When hreflang is Not Needed
- If your site is monolingual, setting hreflang makes little sense
- If Google and your current site settings already correctly determine user language and region (e.g., via clear site structure, canonical tags, and IP targeting), additional hreflang use may bring limited benefit

How to Correctly Configure hreflang
There are several ways to implement hreflang; here are the most common methods.
Via HTML <link rel="alternate"> Tags
The most widespread approach is adding sets of tags in the <head> section of every page indicating alternative language versions. Example for a site with English and Ukrainian versions:
<link rel="alternate" hreflang="en" href="https://site.com/en/" />
<link rel="alternate" hreflang="uk" href="https://site.com/uk/" />
<link rel="alternate" hreflang="x-default" href="https://site.com/" />
Make sure language codes comply with ISO 639-1 standards — e.g., use “uk” for Ukrainian, not “ua” (a common mistake).
Via HTTP Headers
You can specify hreflang in an HTTP Link header, which is suitable for non-HTML resources like PDFs or multimedia files. This method is less common but sometimes necessary for complex projects.
Via XML Sitemap
For very large sites where manual markup is impractical, hreflang can be added in the sitemap in a special format:
<url>
<loc>https://site.com/en/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://site.com/en/" />
<xhtml:link rel="alternate" hreflang="uk" href="https://site.com/uk/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://site.com/" />
</url>
Google’s Recommendations for Configuring hreflang
- Always use the hreflang x-default tag — it signals the universal page version for users whose language is not identified or supported
- Update hreflang tags regularly when the site’s structure or content changes
- Ensure all URLs are indexable (not blocked by robots.txt, no noindex tags, and do not lead to 404 errors)
Common hreflang Configuration Errors
Unfortunately, hreflang implementations often contain mistakes that reduce multilingual SEO effectiveness. The most frequent errors include:
- Lack of reciprocal links: one version points to another, but there is no backlink
- Incorrect language codes: e.g., using “ua” instead of the correct “uk”
- hreflang pointing to non-existent pages — causing indexing errors
- Conflict with canonical tags: if canonical points to a different page, it contradicts hreflang and confuses search engines
- Mixing hreflang and canonical improperly: one tag should not replace the other; both must be used correctly together
How to Verify Correct hreflang Setup
To analyze correctness you can use:
- Any SEO crawler or audit tool that checks hreflang and other SEO issues
- Merkle hreflang Tags Generator & Validator — a handy free tool for generating and validating hreflang tags
- Manual code review — inspecting the <head> and sitemap, verifying page links
Conclusions
The hreflang attribute is a prime example of a detail that makes a big difference. It helps search engines accurately interpret your site’s structure and present users with exactly the page version they need. Without proper hreflang configuration, even the best content may underperform.
Remember that implementing hreflang is not a one-time task but an ongoing process of site maintenance. Check reciprocal links, update tags during redesigns, and ensure no conflicts with canonical tags.
This way, search engines will clearly understand your intentions, and users will see your site in the language, region, and context most relevant to them.