Promptwatch Logo

Hreflang

Hreflang is an annotation that tells search engines which language or regional version of a page to show, set in HTML link elements, HTTP headers or sitemaps.
Updated November 15, 2026
SEO

Definition

Hreflang is an annotation, written as rel='alternate' with an hreflang attribute, that tells search engines a page has equivalent versions for other languages or regions and which URL serves which audience. Google uses it to show searchers the version that matches their language and location. It does not use it to detect the language a page is written in; Google determines that from the visible content.

Google's documentation on localized versions lists three equivalent ways to declare the annotations:

  • HTML: <link rel='alternate' hreflang='de' href='...'> elements in the head of every version.
  • HTTP headers: a Link: response header, which suits PDFs and other non-HTML files.
  • XML sitemap: an xhtml:link child for every variant inside each URL entry of the XML sitemap.

Google says combining methods brings no benefit, so pick one.

Values combine a language code in ISO 639-1 format with an optional region code in ISO 3166-1 alpha-2: de for German anywhere, en-GB for English in the UK, de-ES for German speakers in Spain. A region on its own is invalid, because the first code is always the language (be is Belarusian, not Belgium). Codes outside those standards, such as es-419 for Latin American Spanish, are not supported, and reserved codes like UK or EU have no effect in Google Search. Scripts can be specified with ISO 15924, as in zh-Hant. The reserved value x-default names the fallback page for users whose language matches none of the listed versions, usually a language selector or an auto-redirecting homepage.

Three rules make a set work. Each version must list itself as well as every other version (the self-reference). Annotations must be reciprocal: if two pages don't both point to each other, Google ignores the tags, which stops another site from claiming to be your alternate. And URLs must be fully qualified, including https. Alternates may sit on different domains.

Hreflang interacts closely with canonical URLs. Google's canonicalization guide says a page in an hreflang set should declare a canonical in the same language, or the best substitute language if none exists, and Google prefers URLs that are part of hreflang clusters when it picks canonicals. Pointing every translation's canonical at the English page is a classic mistake: it tells Google the translations are duplicates. Localized pages only count as duplicates when the main content stays untranslated.

Errors are common. Ahrefs' study of 374,756 domains using hreflang found 67% had at least one issue: 56.3% had pages missing x-default, 18% lacked self-referencing tags, 16.9% pointed to redirected or broken pages, 15.3% were missing reciprocal tags and 8% pointed to non-canonical URLs (Ahrefs). Google removed Search Console's International Targeting report, which showed hreflang errors, in September 2022, so checks now happen with crawlers as part of a technical SEO audit.

Bing's position has shifted. A 2011 Bing Webmaster blog post named the content-language meta tag as its first signal for a page's language and country, followed by the Content-Language HTTP header, the country-code domain and server location, which is where advice that Bing ignores hreflang comes from. Bing's December 2025 post on duplicate content, by Fabrice Canel and Krishna Madhavan, now tells sites to 'use hreflang to define language and regional targeting' and lists hreflang relationships among the signals to audit (Bing Webmaster Blog). Bing has not published how it weighs hreflang against the HTML lang attribute and content-language, so keeping all three consistent is the safe choice, even though Google ignores lang.

For AI search, the picture splits by engine. AI Overviews and AI Mode take their links from Google's index, where hreflang already shapes which version ranks, and Microsoft Copilot builds on Bing. OpenAI, Anthropic and Perplexity have not documented whether their retrieval reads hreflang at all. In a December 2025 test, Glenn Gabe found that Google's classic results, Bing, AI Mode and Copilot mostly returned the correct translated URL for French, Italian and Spanish queries, while ChatGPT, Perplexity and Claude usually linked the US English original even when they answered in the user's language (GSQI). That was one practitioner's test on a few queries, not a dataset.

So keep hreflang correct for Google, Bing and the AI features built on them, and don't assume it carries over to other assistants. Give every language its own crawlable URL: Google recommends separate URLs over cookie or browser-based switching, because Googlebot usually crawls from the US without an Accept-Language header, a point also covered under content personalization. Then measure per language. Multilingual AI search visibility explains how to track each language-market as its own prompt set and check which language version each engine cites, and local SEO adds the location layer within a market.

Examples of Hreflang

  • An online retailer with US, UK and Australian English stores finds UK shoppers landing on dollar prices. Adding reciprocal hreflang with self-references, plus an x-default pointing to its country selector, gets Google to show the en-GB pages in the UK.
  • A travel company used `en-UK` in its annotations. Because UK is a reserved code, Google ignored the region, and switching to `en-GB` fixed the targeting.
  • A software publisher had set every translated page's canonical to its English original, and only the English pages were indexed. Self-referencing canonicals on each language version brought the German and French pages back into results.
  • A German B2B brand tracks the same prompts in German and English and sees AI Mode cite its German pages while ChatGPT cites the English ones. It keeps hreflang for Google and works on German third-party coverage for ChatGPT.

Terms related to Hreflang

Canonical URLs

A canonical URL is the preferred version of a page among duplicates. Set with rel=canonical, it tells search engines and AI crawlers which URL to index.

SEO

Multilingual AI Search Visibility

Multilingual AI search visibility is how often a brand appears in ChatGPT, Gemini and Perplexity answers across languages. Each language is its own market.

GEO

XML Sitemaps

An XML sitemap is a file listing a site's canonical URLs, with optional lastmod dates, that helps search engines and AI search discover and refresh pages.

SEO

Local SEO

Local SEO is optimizing a business's listings, reviews and website so it appears for nearby searches in map results, AI Overviews and AI assistants like Gemini.

SEO

Technical SEO Audit

A technical SEO audit checks whether search engines and AI crawlers can fetch, render, index and understand a site's pages, then ranks the fixes by impact.

SEO

Crawling and Indexing

Crawling is how bots discover and fetch web pages; indexing is how search engines and AI systems process and store them so they can be retrieved and cited.

SEO

Content Personalization

Content personalization tailors what a visitor sees to their context or behavior. Done well, it keeps core content identical for people and for crawlers.

Marketing

Google Search Console

Google Search Console is Google's free tool for site owners showing search performance, indexing and crawl data, plus AI Overviews and AI Mode impressions.

SEO

Cross-Platform AI Visibility

Cross-platform AI visibility is how consistently a brand appears and is cited across AI engines such as ChatGPT, Google AI Mode, Gemini, Perplexity and Claude.

GEO

Crawl Budget

Crawl budget is the set of URLs a search engine can and wants to crawl on a site. It matters for large or fast-changing sites; AI crawlers add their own load.

SEO

Frequently Asked Questions about Hreflang

Learn about AI visibility monitoring and how Promptwatch helps your brand succeed in AI search.

Be the brand AI recommends

Monitor your brand's visibility across ChatGPT, Claude, Perplexity, and Gemini. Get actionable insights and create content that gets cited by AI search engines.

Promptwatch Dashboard