Esc
  • Jump to
  • The board
  • All launchesSort and filter by week or category
  • Open statsEvery number, in public
  • Maker storiesApps that stopped hiding
  • Submit a launch
  • AICategory
  • AnalyticsCategory
  • API & BackendCategory
  • Audio & VoiceCategory
  • AutomationCategory
  • CommunityCategory
↑↓ to move↵ to openPress / anywhere
Sign in

What is Hreflang Attribute?

An HTML, HTTP header, or XML sitemap annotation that tells search engines which language and regional variant of a page to serve to users searching from a matching locale.

Updated · SEO & AI Search

Plain definition

Definition of Hreflang Attribute

An HTML, HTTP header, or XML sitemap annotation that tells search engines which language and regional variant of a page to serve to users searching from a matching locale.

Formula / syntax<link rel="alternate" hreflang="en-gb" href="https://example.com/en-gb/pricing" /> | Fallback: hreflang="x-default"

Worked example

Imagine a made-up payroll app called LedgerMint serves three localized pricing pages: US English at https://ledgermint.example/en-us/pricing, UK English at https://ledgermint.example/en-gb/pricing, and German at https://ledgermint.example/de/pricing, plus a language-picker landing page at https://ledgermint.example/pricing. To prevent UK visitors from seeing dollar pricing in Google results, LedgerMint declares hreflang annotations using ISO 639-1 language codes and optional ISO 3166-1 Alpha 2 region codes.

Per Google Search Central's localized-versions guide, LedgerMint can deliver these annotations in one of three equivalent ways: <link rel="alternate" hreflang="..."> tags in the HTML head, Link HTTP response headers (especially useful for non-HTML files such as PDFs), or xhtml:link entries inside an XML sitemap. Crucially, every localized page must list itself and link bidirectionally to its counterparts, alongside an hreflang="x-default" fallback pointing to the selector page for unmatched locales. If /en-gb/pricing points to /de/pricing without /de/pricing pointing back, Google ignores the annotation.

Why it matters when you launch

Most v1 SaaS products ship in English only, and if you serve a single language you do not need hreflang tags at all. The attribute becomes critical as soon as you translate your landing pages, localize currency and VAT copy across countries, or publish region-specific documentation under subdirectories like /de/ or /es/.

Without proper hreflang pairing, search engines may treat your US and UK pricing pages as near-duplicates, fold them under one canonical URL, and show the wrong currency snippet to international buyers. Implementing clean, automated return links in your Next.js metadata generator prevents international traffic leakage from day one of localization.

Common mistakes

  • Omitting bidirectional return links between alternate pages, which causes Google to discard the hreflang mapping entirely to block cross-site spoofing.
  • Forgetting the self-referencing hreflang entry on each localized page or using relative paths instead of full absolute HTTPS URLs.
  • Using invalid country codes such as "en-uk" instead of the ISO 3166-1 Alpha 2 code "en-gb," or writing a country code alone without a language prefix.
  • Pointing every regional variant's rel="canonical" tag back to the English version instead of giving each localized URL its own self-referencing canonical.

Tools and guides that use it

Official sources

Pritam Ghosh runs Hauntboard and maintains this glossary.

Published · Updated

Building something real? Launch it in public.

A person reviews every launch on Hauntboard, and every view and visit it sends your site is published on your launch page. Free to submit.

Launch free →

On the board

All →

Still hiding your app?

Put it on the board. Reviewed by a person, free to launch.

Launch free
Submit a launch