Technical
Also called:
hreflang tag, rel="alternate" hreflang

Hreflang

THE SHORT ANSWER

Hreflang is an HTML attribute that tells search engines which language or regional version of a page to show each searcher, linking equivalent pages such as en-us, en-gb and de versions together.

Hreflang is an HTML attribute that tells search engines which language or regional version of a page to show a searcher. If you have an English page for the US, another for the UK and a Spanish page for Mexico, hreflang helps Google send each visitor to the right one.

What is hreflang?

Hreflang is an annotation, written as rel="alternate" hreflang="x", that links together pages with the same content in different languages or for different regions. Each value combines a language code and, optionally, a region code. For example, "en" means English, "en-gb" means English for the United Kingdom, and "es-mx" means Spanish for Mexico.

According to Google's localized versions documentation, language codes must come from ISO 639-1 and region codes from ISO 3166-1 Alpha 2. A region code can't be used on its own. There's also a reserved value, x-default, that marks a fallback page (often a language or country selector) for visitors whose language you don't specifically serve.

Why hreflang matters

Without hreflang, Google has to guess which version of a page fits a searcher. Regional versions in the same language can look almost identical, which can lead to the wrong version ranking in a market, or to Google folding the pages together as duplicate content.

Hreflang is about matching, not language detection. Google states it doesn't use hreflang or the HTML lang attribute to detect a page's language; it uses its own algorithms. So the page content itself still has to be properly translated and localized.

How hreflang works

Google treats three implementation methods as equivalent. There's no need to use more than one.

  • HTML link tags in the head of each page. The most common option for standard web pages.
  • HTTP headers, useful for non-HTML files such as PDFs.
  • XML sitemap entries, where each URL lists all of its alternates. Handy for large sites, since it keeps annotations out of page templates. See XML sitemap.

Whichever method you choose, three rules apply. Every version must list every other version. Every version must list itself. And alternate URLs must be fully qualified, including the https:// protocol.

Hreflang in practice

Imagine a hypothetical software company with three versions of its pricing page: US English, UK English and German. In the head of each of the three pages, it places the same set of four tags:

  • hreflang="en-us" pointing to https://example.com/pricing
  • hreflang="en-gb" pointing to https://example.com/uk/pricing
  • hreflang="de" pointing to https://example.com/de/preise
  • hreflang="x-default" pointing to https://example.com/pricing

A searcher in London should now see the UK page, a German speaker should see the German page, and someone searching in French gets the x-default version. Google still makes the final call, but it now has clear signals to work with.

Hreflang best practices

  1. Always include return links. Google is blunt here: if two pages don't point to each other, the annotations are ignored.
  2. Self-reference every page. Each page lists itself alongside its alternates.
  3. Use valid codes. "en-gb" is valid. "en-uk" is not, because UK isn't the ISO region code. Google also notes that codes like EU and UN have no effect.
  4. Point to canonical, indexable URLs. Google's canonicalization guidance says each language version should specify a canonical in the same language. As general good practice, hreflang targets should also be live final URLs, not redirects or pages carrying a noindex.
  5. Add x-default when you have a selector page or a sensible global fallback.
  6. Update annotations during migrations. Google's site move guidance lists hreflang among the items to update when URLs change.
  7. Monitor regularly. Hreflang breaks quietly when pages are added, removed or renamed. A crawl tool or site audit can flag missing return links.

Common hreflang mistakes

  • One-way links. The English page points to the German page, but not the reverse.
  • Relative URLs. Paths like /de/preise are not accepted.
  • Using hreflang for untranslated duplicates. Hreflang helps match equivalent pages; it doesn't make a thin copy useful to a new market.
  • Auto-redirecting by IP or language. Google's multi-regional site guidance advises against it, because it can stop users and crawlers from reaching your other versions. Let people switch with visible links.

How Butter approaches hreflang

Most Butter clients run single-language sites, so hreflang only comes up when a business expands into new markets. When it does, we treat it as part of technical SEO: we check that every language version links back to the others, that codes are valid and that targets are canonical, indexable URLs. On our GEO+SEO plan, fixing crawl and on-page issues like these is part of the monthly work. For larger international rollouts, we help plan the URL structure and flag problems, while your developers own the template changes.

Frequently asked questions

Is hreflang a ranking factor?

Hreflang doesn't make a page rank higher. It helps Google choose which of your existing language or regional versions to show a given searcher. Think of it as a routing signal rather than a ranking boost.

Do I need hreflang if my site is only in one language?

No. Hreflang is only useful when you have equivalent pages in more than one language or for more than one region. A single-language, single-market site doesn't need it.

What does x-default mean in hreflang?

x-default is a reserved value that tells Google which page to show when no other language or region matches a searcher's settings. It usually points to a language selector or a global homepage.

Sources and further reading

KEEP LEARNING

100 SEO and GEO terms explained in plain English.

Browse the full glossary →

Know the terms. Now get cited.

Request a free AI visibility audit and see where your brand shows up in ChatGPT, Perplexity, and Google. Starting at $399/month. Cancel anytime.

SCHEDULE A CALL