Hreflang Definition
Hreflang is an HTML attribute that tells search engines which language and, optionally, which country each version of a page is meant for. It helps Google show French users the French page, British users the UK page and American users the US page.
It is essential for multilingual and multi-regional websites. Without it, search engines may show the wrong version, or treat regional versions in the same language as duplicates.
What Is Hreflang?
Hreflang is written as a link element in the <head> of each page, listing all language versions, including itself:
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" /> <link rel="alternate" hreflang="en-us" href="https://example.com/us/" /> <link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/" /> <link rel="alternate" hreflang="x-default" href="https://example.com/" />
Google introduced support in 2011. It is a signal, not a directive: it helps choose which version to show but does not move rankings by itself. Yandex also supports it; Bing relies more on other signals such as the content-language meta tag and the page language.
- Hreflang Codes: Language and Region
- How Hreflang Works
- Three Ways to Implement Hreflang
- Why Hreflang Matters for SEO
- Hreflang and International Site Structure
Hreflang Codes: Language and Region
| Code | Meaning |
|---|---|
| en | English, for all countries |
| en-gb | English for the United Kingdom |
| en-us | English for the United States |
| fr | French, for all countries |
| fr-be | French for Belgium |
| x-default | Fallback page for users who match no listed version |
The language uses ISO 639-1 codes (two letters) and the optional region uses ISO 3166-1 Alpha-2 country codes. A region alone is not valid: hreflang="be" means Belarusian, not Belgium. A classic mistake is en-uk: the correct code for the United Kingdom is gb.
How Hreflang Works
- Each version lists all versions, including itself (self-reference).
- Links must be reciprocal: if the UK page points to the US page, the US page must point back. Without return links, Google may ignore the annotations.
- URLs must be canonical and indexable: each listed URL should return 200, carry a self-referencing canonical tag and not be blocked or noindexed.
- x-default designates the page for everyone else, often a language selector or the main international version.
Hreflang works between pages that are true equivalents. It does not consolidate signals like a canonical; each version must be able to rank on its own.
Three Ways to Implement Hreflang
| Method | Best for |
|---|---|
| HTML link elements in the head | Most sites; easy to check in the source code |
| HTTP Link headers | Non-HTML files such as PDFs |
| XML sitemap with xhtml:link entries | Large sites, or when templates are hard to change |
Use one method per set of pages. Mixing methods with contradictory data creates errors. On WordPress, multilingual plugins such as WPML or Polylang generate hreflang automatically; when language versions live on separate installations, the annotations must be added manually or with a dedicated tool. The XML sitemap method is often the cleanest for large catalogs.
Why Hreflang Matters for SEO
- Right version, right user: visitors land on their language and currency, which improves engagement and conversions.
- No regional duplicates: UK and US pages with similar English text are understood as alternates, not as duplicate content.
- Better international visibility: each local version can appear in its own country’s results.
- Cleaner reporting: traffic arrives on the version built for each market.
Hreflang and International Site Structure
Hreflang works with any URL structure, but the choice of structure matters for geotargeting:
- Country domains (ccTLD): example.fr, example.de. Strong country signal, more domains to manage.
- Subdirectories: example.com/fr/, example.com/en/. One domain, shared authority, easy to manage. This site uses this model with its English version under /en/.
- Subdomains: fr.example.com. Workable, but often treated more like separate sites.
Avoid automatic redirects based on IP address or browser language: crawlers mostly come from the US and may never see other versions. Offer a visible language switcher instead.
Example: A Business Serving the UK and France
A company has three versions of its services page: one for the United Kingdom, one for the United States and one in French for France. Each page contains the same four annotations in its head, pointing to /uk/services/ with en-gb, /us/services/ with en-us, /fr/services/ with fr-fr, and the international page with x-default.
The result: a searcher in Manchester sees the UK page with prices in pounds, a searcher in Chicago sees the US page in dollars, a searcher in Lyon sees the French page, and a searcher in Canada or Australia, who matches no specific version, sees the x-default page with a country selector.
If the company later adds a Belgian French page, it must add a fr-be line to all four existing pages and list all five versions on the new one. Forgetting the existing pages is the most common way a working setup breaks over time.
Common Hreflang Mistakes
- Missing return links between versions.
- Wrong codes:
en-uk,es-la, country without language. - Hreflang pointing to redirected, noindexed or non-canonical URLs.
- Canonical tags pointing all language versions to one language.
- Relative URLs instead of absolute URLs.
- Annotations on the home page only, while inner pages have none.
- Untranslated pages declared as alternates (same text, different code).
How to Check Hreflang
- Page source: check that every version lists all others and itself, with absolute URLs.
- A crawler such as Screaming Frog validates return links, codes and target status across the site.
- Google Search Console: performance reports filtered by country show whether the right version gets impressions in each market.
- Search from each country with a VPN or the location settings of a rank tracker to see which version appears.
Hreflang setups are a recurring source of errors, which is why they are always reviewed in a technical SEO audit of international sites.
Hreflang: Key Takeaways
Hreflang tells search engines which language and country each version of a page targets. Use valid ISO codes, list every version on every page including itself, keep links reciprocal, point only to canonical indexable URLs, add an x-default, and choose one implementation method. Done right, each market sees its own page; done wrong, the annotations are silently ignored.
From theory to the right market
Knowing what hreflang is is the first step. The next is checking that each of your language versions is the one Google shows in its own market.
- An action plan adapted to your situation
- Clear explanations, no needless jargon
- Direct application to your sector
From diagnosis to results, step by step
Here is how I handle hreflang issues on client sites, and what my clients say about my work.
What Is Hreflang?
Hreflang is written as a link element in the <head> of each page, listing all language versions, including itself:
Hreflang Codes: Language and Region
CodeMeaningenEnglish, for all countriesen-gbEnglish for the United Kingdomen-usEnglish for the United StatesfrFrench, for all countriesfr-beFrench for…
How Hreflang Works
Each version lists all versions, including itself (self-reference).Links must be reciprocal: if the UK page points to the US page, the US page must point back. Without…
FAQ: Hreflang
What is hreflang?
An attribute that tells search engines which language and optional country each version of a page targets, so users see the right version.
Is hreflang a ranking factor?
No. It helps search engines choose which version to show to each user, but does not improve rankings by itself.
What is x-default?
The hreflang value for the fallback page shown to users whose language or country matches no listed version.
Why are return links required?
Each version must confirm the relationship. Without reciprocal annotations, Google may ignore them, since anyone could otherwise claim your pages as alternates.
Is en-uk a valid hreflang code?
No. The country code for the United Kingdom is gb, so the correct value is en-gb.
Do I need hreflang for a site in one language?
No. Hreflang is only needed when equivalent pages exist in several languages or for several countries.
Hreflang Resources:
Do you want to work with me?
I am SeoYass, an SEO expert with over 17 years of experience. I have worked with small and medium-sized businesses, successfully completing more than 350 projects.
Passionate about local SEO, I continue to learn and refine my strategies to deliver the best performance for my clients.

