What hreflang is
hreflang is how a page declares its language and country versions, so Google can serve each searcher the right one — Spanish speakers the Spanish page, UK visitors the UK pricing:
<link rel="alternate" hreflang="en" href="https://example.com/guide" />
<link rel="alternate" hreflang="es" href="https://example.com/es/guia" />
<link rel="alternate" hreflang="x-default" href="https://example.com/guide" />
Each line says "this same content, in this language (optionally: for this country), lives at
this URL". x-default names the fallback for everyone who matches no listed version. The codes
are standardized: es (Spanish), es-mx (Spanish, Mexico), de-ch (German, Switzerland).
Why it exists
Without hreflang, near-identical pages in different languages or for different countries compete against each other, and searchers land on the wrong version — a German visitor on the US page with dollar prices. hreflang groups the versions into one set: rankings are shared across the cluster while each searcher sees their own edition. It's a targeting mechanism, not a ranking boost.
The strict rules
hreflang fails quietly when its bookkeeping is off. Two rules cause almost all failures, straight from Google's documentation:
- Every page must list itself. The English page's set must include the English page's own URL. A set without a self-reference may be ignored.
- Annotations must be reciprocal. If the English page lists the Spanish one, the Spanish page must list the English one back. One-way declarations don't count — this is the guard against a stranger's page claiming to be your "alternate".
Practical consequences: generate hreflang from one shared template (hand-maintained sets drift), point every entry at the final canonical URL — not at a redirect — and keep the set identical on every page in the group.
When you don't need it
One language, one market: skip hreflang entirely. A missing hreflang setup on a monolingual site isn't a problem — a half-correct one on a multilingual site is.