Skip to content
Renderly
Menu

Glossary · Technical

hreflang

Also called: rel=alternate hreflang, x-default · Updated 6 November 2026

hreflang is an HTML attribute (also usable in HTTP headers and XML sitemaps) that tells search engines which language or regional versions of a page exist, so they can show users the right one.

If you have English pages for the US and the UK and a German page, hreflang tells Google which one to show in each market. Google and Yandex support it. Bing mostly relies on the content-language meta tag and other signals instead.

Example

Every version lists all versions, including itself, plus an optional x-default fallback:

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

Language codes use ISO 639-1 (en, de). Optional region codes use ISO 3166-1 alpha-2 (us, gb). See Google’s localized versions guide.

Three ways to implement

  • <link> tags in the <head>: simple, fine for small sites.
  • HTTP headers: for PDFs and other non-HTML files.
  • XML sitemap entries: easier to maintain on large sites, keeps the HTML lighter.

Common mistakes

  • Missing return links. If page A points to B but B does not point back to A, Google ignores the pair.
  • Wrong codes, such as en-uk instead of en-gb, or a region without a language (us).
  • Each language version canonicalized to the English page, which tells Google the translations are duplicates.
  • hreflang pointing at redirected or noindex URLs.
  • Automatic IP-based redirects that stop crawlers from reaching other versions.

How Renderly handles it

We generate hreflang from the CMS’s locale data and validate the full set on every build. See our technical SEO service.

Next step

Want to know where your site stands?

Send us the URL. We run the crawl, the rendering check and an answer engine visibility sample, then reply with the three fixes that matter most.