Hreflang, n.

What is hreflang?

An HTML attribute that tells search engines which language and regional versions of a page exist, so each user sees the right one.

Filed under meta tags and on-page seo in the SEO glossary

Try the free seo checker

What hreflang does

Hreflang annotations link equivalent pages in different languages or for different regions, such as English for the US, English for the UK and Spanish. Search engines then show a searcher the version that matches their language and location, instead of treating the versions as duplicates.

You can declare hreflang with <link rel="alternate" hreflang="..."> tags in the head, in HTTP headers, or in the XML sitemap. Google supports all three. Bing relies more on the content-language meta tag and the page's own language.

Syntax rules

The value is an ISO 639-1 language code, optionally followed by an ISO 3166-1 alpha-2 region code: en, en-gb, es-mx. A region on its own, such as gb, is invalid, and en-uk is wrong because the code for the United Kingdom is gb.

Every page must list all versions including itself, and each version must link back (return links). Add hreflang="x-default" for the fallback page shown when no version matches, often a language selector or the international homepage.

Common hreflang errors

Missing return links, wrong codes, pointing to URLs that redirect or return 404, and hreflang URLs that conflict with the canonical tag (each version should canonicalise to itself, not to one master language) are the usual problems. Any of them can make Google ignore the whole set.

Example

Hreflang for three versions:

<link rel="alternate" hreflang="en-us" href="https://example.com/us/">
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/">
<link rel="alternate" hreflang="es" href="https://example.com/es/">
<link rel="alternate" hreflang="x-default" href="https://example.com/">
Check it on your site: SEO checkerScore any page against 35 on-page, technical and performance checks. Free, no signup.
Questions

Frequently asked questions

Is hreflang a ranking factor?

No. It does not boost rankings; it helps search engines show the right version of a page to each audience.

Do I need hreflang for a single-language site?

No. Hreflang is only useful when you have equivalent pages in more than one language or regional variant.

What does x-default mean?

It names the page to show users whose language or region does not match any listed version.

Related terms

Keep learning

Full SEO glossary

More free tools

Check the rest of your SEO

All free SEO tools

Find every issue like this across your site

Fix it automatically, then see what the fix earned.

  • The AI drafts the fix for every issue like this across your site, ranked by impact
  • Approve it and the free WordPress plugin publishes it, with one-click undo
  • 28 days later, the clicks each fix earned, from your own Search Console
Fix my site free Free plan, no card · not on WordPress? Copy each fix in