Hreflang

Hreflang is an HTML link attribute used to specify the language and geographical targeting of a webpage. By mapping corresponding URLs across regional versions of a site, hreflang annotations direct search engines to display the appropriate linguistic or regional version to users based on their location and browser settings.

In plain English

If your website serves an international audience, you may publish content in multiple languages (such as English, French, and German) or offer localized variations of the same language across different geographical regions (such as English for visitors in the United States, the United Kingdom, and Australia).

Without clear technical instructions, search engines struggle to resolve two common problems. First, an English-speaking user in London searching for your services might mistakenly be directed to your American webpage, showing prices in US dollars and listing domestic shipping policies. Second, because your US and UK pages contain almost identical English text, search algorithms might treat them as duplicate content, suppressing one regional version from search results entirely.

Hreflang is the technical standard that resolves both issues. It is an HTML link attribute that connects alternate regional and linguistic versions of a webpage together in an explicit, mutually verified network.

An example

Consider an online software company that maintains three separate regional landing pages for its software pricing:

  • United States English: https://example.com/pricing
  • United Kingdom English: https://example.com/en-gb/pricing
  • Spain Spanish: https://example.com/es/pricing

To inform search engines of this relationship, the webmaster places bidirectional <link rel="alternate" hreflang="..."> tags in the <head> section of all three pages (or declares them in an XML sitemap):

html
<link rel="alternate" hreflang="en-us" href="https://example.com/pricing" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/en-gb/pricing" />
<link rel="alternate" hreflang="es" href="https://example.com/es/pricing" />
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing" />

Several strict technical rules govern this implementation:

  1. Self-referential links: Each page must include an hreflang tag pointing back to itself as well as to its regional siblings.
  2. Bidirectional verification: If page A points to page B with an hreflang tag, page B must point back to page A. If the return tag is omitted, search engines ignore the annotation to prevent third-party domains from falsely claiming to be your regional alternate.
  3. The x-default attribute: This declares the fallback landing page for searchers whose language or region does not match any explicitly declared translation.

When a user in Madrid searches for the software, Google detects the Spanish hreflang declaration and serves the /es/pricing URL in search results automatically.

Why it matters

Implementing accurate hreflang tags eliminates international duplicate content confusion and guarantees that global searchers arrive on the correct regional page. Serving localized content in the user’s native currency and language improves click-through rates, reduces immediate bounce rates, and boosts global conversion rates across every international market you target.

Read the full guide to technical SEO, or explore our complete guide to hreflang.