Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website. More information

Accept all cookies

What Is Hreflang? The Guide to Multilingual SEO

Hreflang is an HTML annotation that tells search engines which language and region a page targets, serving the right version to each user and avoiding duplicate content.

Man with dark hair and beard wearing a light brown shirt speaks in front of a microphone on a podcast or recording setup.Portrait of a man with short dark hair wearing a white shirt and dark jacket, looking directly at the camera with a neutral expression.Man with short dark hair, beard, and clear glasses wearing a black t-shirt with a white circular logo, standing in front of a stone wall.Celio fabianoSmiling young woman with long brown hair wearing a red top and necklace, outdoors in a tree-filled background.photo de profil du client Xavier Breull
+ 9'000 subscribers
A diagram showing how hreflang tags connect content versions across different languages and regions.
Upload UI element
Thibault Besson-Magdelain fondateur de Sorank

About Author

Thibault Besson-Magdelain

Founder of Sorank, 5+ years of experience in SEO, GEO enthusiast.
Share on

Summary: Hreflang is an HTML attribute that signals the language and regional targeting of a page. It tells Google and other search engines to serve the correct version of your content to each user, prevents duplicate-content conflicts, and is essential for any multilingual or multiregional website.

If your site exists in more than one language, or targets the same language across different countries, search engines need help deciding which version to show to which user. A French speaker in Canada and one in France should see different pages. Hreflang (the rel="alternate" hreflang annotation) is how you tell search engines about these relationships, so the right page reaches the right audience.

Without hreflang, your localized pages can compete against each other in search results, get flagged as duplicate content, or simply show the wrong version to a user. With it, Google groups your language and region variants into a single cluster and serves the most appropriate one. It is one of the most powerful, and most frequently misconfigured, tools in international SEO.

What Hreflang Does and Why It Exists

Hreflang solves the localization-matching problem. When you publish the same content in English, Spanish, and German, those pages are near-duplicates of one another. Search engines could mistakenly treat them as copied content or pick the wrong one to rank. The hreflang annotation tells them these pages are intentional alternates, each made for a specific language or locale.

The result is a better user experience and cleaner indexing. Google's documentation on localized versions explains that hreflang lets Google point users to the page in their own language and region, rather than serving a version they cannot read or one with the wrong currency, shipping, or legal information.

The Hreflang Syntax

An hreflang annotation in the page head looks like this: <link rel="alternate" hreflang="en" href="https://example.com/en/" />. The rel="alternate" declares that the linked URL is an alternate version, the hreflang value states the language (and optionally the region), and the href gives the full, absolute URL of that version.

You include one such tag for every version, on every page. A page that exists in three languages carries three hreflang tags, one pointing to each version, including a tag pointing to itself. Each language variant repeats the same complete set. This is what allows search engines to map the entire group together.

Language and Region Codes

The hreflang value uses standardized codes, and getting them right is non-negotiable. The language is given in ISO 639-1 format (for example en, es, de). You can optionally add a region in ISO 3166-1 Alpha 2 format, joined by a hyphen: en-GB, en-US, es-MX, fr-CA.

The language always comes first; a region alone is invalid. You cannot use hreflang="GB" on its own, and made-up codes such as en-UK or EU do not work (the correct code for the United Kingdom is GB). For script variations, ISO 15924 codes apply, such as zh-Hant for Traditional Chinese and zh-Hans for Simplified Chinese. Invalid codes are simply ignored, silently breaking your setup.

Bidirectional and Self-Referencing Tags

Hreflang must be reciprocal. If page X points to page Y as its Spanish alternate, then page Y must point back to page X as its English alternate. Google calls these return tags, and if they are missing, it may ignore your annotations entirely. This return-link requirement is the single most common reason hreflang fails in practice, as Google's multi-regional sites guidance stresses.

Equally important, every page must reference itself. The English page includes an hreflang tag for English pointing to its own URL. Omitting the self-referencing tag is another frequent error. Treat the rule as absolute: each page lists itself plus every other version, and every version returns the favor.

The x-default Value

The special value hreflang="x-default" tells search engines which page to show when none of your specified languages or regions match the user. It is a fallback. A common use is a language-selection landing page or your primary global version: <link rel="alternate" hreflang="x-default" href="https://example.com/" />.

Adding x-default is a best practice for international sites. Without it, a user whose language and region do not match any of your variants is left to the search engine's best guess. With it, you control the default experience, for instance directing an unmatched visitor to a page where they can choose their own language.

Three Ways to Implement Hreflang

Google supports three implementation methods, and you should pick one rather than mixing them. The first is HTML link tags placed in the <head> of each page, the most common approach for standard web pages. The second is HTTP headers, used for non-HTML files such as PDFs where you cannot add markup to the body.

The third method is the XML sitemap. Instead of adding tags to every page, you declare all language relationships inside your XML sitemap using xhtml:link entries. This keeps page code clean and is often easier to maintain at scale, though it requires careful generation. Whichever method you choose, apply it consistently across the whole site.

Hreflang and Canonical Tags

Hreflang and canonical tags work together, but a classic mistake breaks both. Each language version should canonicalize to itself, not to a single master version. If your German page sets its canonical tag to the English URL, you are telling Google the German page is a duplicate that should not be indexed, which destroys your hreflang setup.

The correct pattern is a self-referencing canonical on every localized page, combined with the full set of reciprocal hreflang tags. The canonical confirms each page is the preferred version of itself, and hreflang describes the relationships between those distinct, equally valid pages. Conflicting signals here are a top cause of indexing problems on multilingual sites.

Hreflang and Local SEO

Hreflang is closely tied to local SEO when you serve the same language across multiple countries. A business operating in both Spain and Mexico publishes Spanish pages for each, but prices, shipping, and tax differ. Tags like es-ES and es-MX let Google route Spanish speakers to the version built for their country.

Hreflang only handles language and region matching, not content quality. Google's systems detect unedited machine translation with high accuracy, and thin translated pages can suppress rankings across all versions, not just the translated one. Pair correct hreflang with genuinely localized, human-reviewed content for each market to see the full benefit.

Common Hreflang Mistakes

Surveys of international sites repeatedly find that a large majority carry hreflang errors. The most frequent are missing return tags, absent self-referencing tags, invalid or region-only language codes, using relative instead of absolute URLs, and pointing hreflang at URLs that redirect or return errors instead of live pages.

Validate your setup after every change. Google Search Console once offered an International Targeting report, and dedicated hreflang checkers plus crawlers such as Screaming Frog confirm that your annotations are reciprocal and use valid codes. As part of broader technical SEO, a regular audit catches these silent failures before they fragment your international rankings.

Conclusion

Hreflang is the annotation that makes multilingual and multiregional SEO work. It maps your language and region variants into one group, serves each user the right page, and prevents duplicate-content conflicts. The rules are strict: valid ISO codes, reciprocal return tags, self-references on every page, an x-default fallback, and self-referencing canonicals that never point across languages. Get these right and your international content reaches the audiences it was made for. Discover how Sorank audits hreflang and your full technical setup for search and AI engines.

Frequently questions asked

What is the difference between hreflang and a canonical tag?

A canonical tag tells search engines which URL is the preferred version of a page, while hreflang tells them which language or region a page targets. They serve different jobs and must not conflict. On a multilingual site, each localized page should have a self-referencing canonical (pointing to itself), plus a full set of reciprocal hreflang tags describing the other language versions. The classic mistake is canonicalizing every language version to one master URL, which tells Google the other versions are duplicates and breaks the hreflang setup entirely.

Do I need hreflang if my site is only in one language?

Not usually. Hreflang exists to map relationships between multiple language or regional versions of the same content, so a single-language site targeting one country generally does not need it. The exception is when you serve the same language to different countries with meaningfully different content, such as English pages for the United States and the United Kingdom with different pricing or shipping. In that case, tags like en-US and en-GB help Google route each audience to the right version even though both are in English.

Why are my hreflang tags being ignored by Google?

The most common cause is missing return tags. Hreflang must be reciprocal, so if page X points to page Y but page Y does not point back to X, Google may disregard the annotations. Other frequent reasons include invalid language codes (such as region-only codes or made-up values like en-UK), missing self-referencing tags, using relative instead of absolute URLs, and pointing hreflang at URLs that redirect or return errors. Validate your setup with a crawler or hreflang checker to confirm every reference is reciprocal, absolute, and uses correct ISO codes.

Our Blog for Ambitious Company