gaash.ai

hreflang

hreflang is an HTML attribute (and an equivalent HTTP-header or sitemap entry) that tells search engines which language and, optionally, which region a given URL is meant for. If you publish the same content in several languages, or the same language for several countries, hreflang links those versions together so a searcher lands on the one built for them instead of a mismatched one.

Why hreflang matters

Once you run more than one language or country version of a site, you have a routing problem: search engines have no built-in way to know that your /de/ and /en/ pages are the same page for different audiences. Without hreflang, a shopper in Vienna can land on the US page with dollar pricing, or a French visitor gets served English by default. That costs conversions, not just polish. hreflang also keeps near-duplicate versions — say, German for Germany and German for Switzerland — from being read as duplicate content that dilutes each other's ranking. Sites doing real business across borders see this most directly: fewer visitors bouncing off the wrong version, and a cleaner signal to search engines about which URL serves which market.

How hreflang works technically

Values follow ISO codes: a language alone ("de"), or a language-region pair ("de-AT" for German as spoken in Austria). You can declare it in three places — the page's HTML <head>, an HTTP header (useful for non-HTML files like PDFs), or the XML sitemap. The rule that trips people up is reciprocity: if the German page points to the English one, the English one must point back to the German one, and every version needs a self-referencing tag too. Search engines discard one-directional hreflang as unverifiable. There's also "x-default", a fallback tag for visitors who don't match any of your declared language-region pairs, typically pointing at a language-selector page or your default market.

Common mistakes

The most common failure is a missing return link: page A points to page B, but B never points back, so Google treats the pair as invalid. Wrong codes are just as frequent — mixing up language and country codes, or writing invented combinations like "en-UK" instead of the correct "en-GB". A canonical tag that contradicts your hreflang setup will also undo it: if a page's canonical points to a different language version, you're telling search engines to ignore the very alternates you just declared. Pointing hreflang at redirected, noindexed, or otherwise non-canonical URLs causes the same silent failure. None of these throw a visible error, so it's worth checking your markup with a validator periodically rather than assuming it still works after a migration or a template change.

Relation to AI search

Google has been explicit that AI Overviews and AI Mode don't require any AI-specific markup, and the same logic applies here: hreflang isn't a lever built for AI citation, it's the correction to a much older problem of serving the right locale. That said, AI assistants that cite web pages still have to pick one URL to point to, and if your language versions are cleanly linked and canonically consistent, you reduce the odds that a crawler picks the wrong regional version, or gets confused enough to skip citing you altogether in that market. Treat it as table-stakes technical hygiene that removes one source of confusion for any system reading your site, human or automated, rather than as an AI-visibility tactic in its own right.

Example

A furniture retailer sells into Germany, Austria, and Switzerland. All three markets read German, but prices, currency, and shipping terms differ. The retailer sets up "de-DE", "de-AT", and "de-CH" versions with full reciprocal hreflang between them. A shopper searching from Zurich now lands on the Swiss version with franc pricing instead of the German one priced in euros. Without the markup, the three near-identical pages would compete for the same queries, and visitors would land on the wrong country's page more often than not.

Common questions

Do I need hreflang if I only publish in one language?

No. hreflang only does work when you have two or more language or country versions of the same content. A single-language, single-market site has nothing for it to link.

Is hreflang a ranking factor?

Not directly. It doesn't boost a page's ranking on its own — it determines which version of a page gets shown to which searcher. That routing indirectly helps click-through rate and prevents your own language versions from competing with each other.

Related terms