What is hreflang?

DEFINITION

Hreflang is an HTML attribute that tells search engines which language or regional version of a page to show users in different countries or languages.

Hreflang is an attribute used on websites that offer the same content in multiple languages or for multiple regions. Each version lists all its alternates, for example <link rel="alternate" hreflang="es" href="https://example.com/es/"> for Spanish or hreflang="en-gb" for English in the United Kingdom. The codes use ISO 639-1 for language and optionally ISO 3166-1 Alpha 2 for region.

A special value, x-default, marks the fallback page for users whose language or region does not match any listed version, often a language selector or the main English page.

Why hreflang matters

Without hreflang, a searcher in Mexico might land on your English page, or Google might treat your US and UK English pages as duplicates. Proper tags help search engines serve the right version to the right audience, improving the experience and conversions for international visitors. Note that Google supports hreflang, while Bing relies more on the content-language meta tag and other signals.

How it works in practice

A software company with English, German and French pricing pages would add three hreflang links plus an x-default to each of those pages, so every version references itself and the others. Tags can be placed in the HTML head, in HTTP headers (useful for PDFs) or in the XML sitemap. Whichever method you choose, the annotations must be reciprocal: if page A points to page B, page B must point back to page A.

Best practices

  • Include a self-referencing hreflang on every page alongside its alternates.
  • Use correct codes, such as en-gb for the United Kingdom, not en-uk.
  • Point hreflang only to canonical, indexable URLs that return a 200 status.
  • Translate content fully, including titles, descriptions and navigation, rather than just swapping a few words.

Common mistakes

  • Forgetting return links, so the annotations are not confirmed and may be ignored.
  • Using a region code alone, such as hreflang="uk", which is not valid without a language.
  • Setting each translated page's canonical to the English version, which conflicts with hreflang.
Try it free: Meta Tag & Google PreviewWrite your page title and meta description and see exactly how they look on Google, with live length checks. Copy ready-to-use meta tags. Free.

Frequently asked questions

Do I need hreflang for a single-language website?

No. Hreflang is only needed when you have multiple versions of content for different languages or regions. A single-language site serving one market gains nothing from it. Add it once you launch translated pages or region-specific versions with different prices or details.

Is hreflang a ranking factor?

Not in the sense of boosting rankings. It helps search engines swap in the most appropriate version of a page for each user's language and location. The benefit is that the right audience sees the right page, which usually improves engagement and conversions.

Where should I put hreflang tags?

You can use link elements in the HTML head, HTTP headers, or entries in your XML sitemap. All three are supported by Google. Sitemaps are often easiest to manage on large sites, while head tags are common on smaller ones. Pick one method and apply it consistently.

Need help with this?

Référencement naturel (SEO) by VYZEON — Soyez trouvé en premier — sur chacun de vos marchés.

Fixed packages from $149/mo. Written scope, no surprises.

See Référencement naturel (SEO)

Related terms

More SEO terms