Back to “Technical SEO basics”
Technical SEO basics4 min read

The hreflang tag (multilingual)

How to signal the right language version of a page to search engines, with correct syntax and the most common reciprocity mistakes.

The hreflang tag tells search engines which language or regional version of a page to show a given user, when the same content exists in several languages or targets several countries.

Use case: when hreflang becomes necessary

As soon as a site offers the same page (or an equivalent page) in several languages, or the same language adapted for several countries (French from France vs. French from Belgium, for example), the engine needs to know which one to show which user. Without hreflang, it risks showing the English version to a French-speaking user, or indexing the different versions as competing duplicate content rather than as complementary versions.

This perceived-duplication risk is the most misunderstood part of the tag: without hreflang, two very similar English and French pages can be read as two redundant translations of the same content rather than as two versions aimed at distinct audiences, which can hurt the ranking of both instead of reinforcing each other.

Conversely, a site offering only one language has no need for hreflang at all: adding the tag without real multilingual content brings nothing and needlessly complicates site maintenance.

Correct syntax

The declaration usually goes in the <head> of each page, with a link to every available language version, including itself:

<head>
  <link rel="alternate" hreflang="fr" href="https://example.com/fr/guide" />
  <link rel="alternate" hreflang="en" href="https://example.com/en/guide" />
  <link rel="alternate" hreflang="es" href="https://example.com/es/guide" />
  <link rel="alternate" hreflang="x-default" href="https://example.com/en/guide" />
</head>

The language code follows the ISO 639-1 standard (fr, en, es), and can be combined with an ISO 3166-1 country code to target a specific regional variant (fr-BE for Belgian French, en-US for American English). Hreflang can also be declared through the XML sitemap instead of in each page's <head>, an approach often preferred on sites with a large number of multilingual pages, since it centralizes every declaration in a single file that's easier to generate and maintain automatically.

Reciprocity: the most commonly broken rule

Every page declaring an alternate version must itself be declared back by that alternate version. If the French page points to the English page via hreflang, the English page must point back to the French page. A non-reciprocal hreflang link is generally ignored by engines, which cancels the markup's effect without any error being clearly shown.

This rule becomes hard to maintain manually once a site passes three or four languages: adding a new language means updating the hreflang declaration on every existing page in every other language, not just on the newly created pages. This is one reason automatic generation through a content management system or a dedicated sitemap sharply reduces the risk of error compared to a manual, page-by-page declaration.

The often-forgotten x-default

The x-default value indicates which version to show users whose language or location doesn't match any of the explicitly declared versions. Without it, those users get an arbitrary choice from the engine, sometimes inconsistent with the site's intent. x-default generally corresponds to the site's international or English version, but it can also point to an explicit language-selection page if the site has no obvious default version.

Common mistakes

  • Non-reciprocal hreflang links between language versions.
  • Incorrect language or country codes (mixing up the language code and country code, e.g. writing fr-FR as FR-fr).
  • hreflang pointing to a URL that redirects or returns a 404, instead of the final URL.
  • Combining hreflang with a canonical tag that points to a single "master" version, which contradicts the very purpose of hreflang — each language version should have its own canonical, pointing to itself.
  • Forgetting x-default on a site with a large international audience.
  • Declaring a language in hreflang without the target page's content actually being translated into that language (a duplicated but untranslated page, left in place temporarily).

Checking your implementation

An incorrect hreflang deployment often goes unnoticed visually (the site works normally for a direct visitor) but can durably skew international rankings. Systematically checking link reciprocity, especially after adding a new language, avoids this kind of silent error.

A simple test is to open the source code of each language version and check, for every declared hreflang link, that the target page declares an equivalent link back. On a large site, this check is more realistic with an automated crawling tool that lists inconsistencies than done manually, page by page.

For the full set of points to check before going live, see the complete technical checklist, and for managing old URLs during a multilingual reorganization, the lesson on redirects and HTTP errors.