hreflang and country targeting
hreflang tells search engines which language and regional version of a page to show, based on the user's language and region preferences — it is not a geolocation mechanism. This page explains what hreflang does, how it differs from edge country, and the common mistakes operators make.
What hreflang does
hreflang annotations tell search engines that several URLs are language or regional variants of the same content. Google uses them to help serve the most appropriate version for a user's language and region preferences. The optional region in an hreflang value (for example en-GB) refines targeting, but the annotation describes page variants, not a visitor's location.
It is a hint to search engines, applied when results are assembled — not something that measures or detects where a person is.
Common mistakes
Operators often treat hreflang as if it geolocated users or controlled who can reach a page. It does neither. Mismatched or non-reciprocal hreflang annotations, missing return links between variants, and using region codes without a language are frequent errors.
Keep hreflang (a search-targeting signal) separate from edge country (a coarse audience estimate). They answer different questions and should not be wired together.
- hreflang signals language/region to search, not geolocation
- Annotations should be reciprocal between variants
- Do not use a region code without a language
How it appears in analytics and logs
hreflang influences which localized URL a search engine surfaces for a query, based on language and region. It is a search-targeting signal, not a measurement of where a visitor is, and it does not geolocate anyone.
Diagnostic use case
Use hreflang to signal language and regional page variants to search engines, while keeping it distinct from edge-derived country geolocation.
What WebmasterID can help detect
WebmasterID keeps audience country (a coarse edge estimate) distinct from hreflang (a search-targeting annotation), so you do not confuse a search-config signal with where your audience is.
Common mistakes
- Treating hreflang as a geolocation or access-control mechanism.
- Using a region code (e.g. -GB) without a language code.
- Setting non-reciprocal hreflang annotations between variants.
Privacy and accuracy notes
hreflang involves no visitor location data — it annotates page variants for search engines. Edge country, by contrast, stays a coarse, privacy-safe estimate. The two should not be conflated.
Related pages
- CDN edge country vs user country: why they differ
Many stacks derive a visitor's country from a CDN or edge header. That header reflects the network path and the edge's best estimate — not a verified user location. This page explains how edge geo headers are produced, why edge country and user country can diverge, and how to present country data honestly.
- Interpreting traffic from Spain
A Spain country value is a coarse edge estimate, and language targeting adds nuance: Spanish has many regional variants worldwide, and Spain itself has co-official regional languages. This page explains how to read Spanish traffic without conflating country with language.
- Privacy-first analytics
Audience country stays a coarse, privacy-safe estimate.
Sources and verification notes
- Google Search Central — tell Google about localized versionshreflang signals language/region for search, not geolocation.
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.