Hreflang Tags: How to Target Countries and Languages

Hreflang is an HTML attribute that tells search engines which language and regional version of a page to show to which users. If you have an English page for the UK, another for the US and a French version, hreflang helps Google send each searcher to the right one. It is a specialist area of technical SEO for international sites.

Why hreflang matters

Without it, Google may show your US page to British searchers, with dollar prices and American spelling, or treat near-identical UK and US pages as duplicates. Hreflang does not boost rankings directly, but it puts the right page in front of the right audience, which improves clicks and conversions.

Hreflang syntax

<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" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
  • The language code uses ISO 639-1 (en, fr, de).
  • The optional region uses ISO 3166-1 alpha-2 (gb, us, ie). Note the UK is “gb”, not “uk”.
  • x-default is the fallback for users who match no listed version, often a language selector or global page.

The rules that trip people up

  1. Return links: every page must list all versions, including itself. If page A points to B, B must point back to A, or the tags are ignored.
  2. Canonical alignment: each version should carry a self-referencing canonical tag. Never canonicalise the US page to the UK page while also declaring hreflang between them.
  3. Indexable URLs only: no redirects, noindex pages or 404s.
  4. Absolute URLs: include the protocol and domain.

Three ways to implement hreflang

  • HTML head tags: simplest for small sites.
  • HTTP headers: for non-HTML files like PDFs.
  • XML sitemap: easiest to manage at scale. See our XML sitemap guide.

On WordPress, multilingual plugins such as WPML, Polylang and TranslatePress add hreflang automatically.

URL structures for international sites

Country-code domains (example.fr), subfolders (example.com/fr/) and subdomains (fr.example.com) all work with hreflang. Subfolders are usually easiest because they share the main domain’s authority. Our URL structure entry discusses the trade-offs.

How to check hreflang

Crawl the site with Screaming Frog and use its hreflang reports to find missing return links, wrong codes and non-canonical targets. Online hreflang testers check single pages.

Frequently asked questions

Do I need hreflang for a single-language site?

No. It only helps when you have multiple language or regional versions.

Does Bing use hreflang?

Bing relies more on the content-language meta tag and other signals.

Related terms

See duplicate content, site architecture and the SEO encyclopedia.

Mr. SEO is the webmaster at SEO TT - SEO tips and tricks, a publication about all things SEO related.