Skip to content
Now accepting Q2 projects — limited slots available. Get started →
SEO · Updated Apr 30, 2026

What is hreflang?

Hreflang is an HTML attribute that tells search engines which language and region a page targets.

What is Hreflang?

Hreflang is an HTML attribute (formally rel="alternate" hreflang="x") introduced by Google in December 2011 to indicate the language and optional regional targeting of a webpage. It helps search engines serve the correct localized version of a page to users based on their language preferences and geographic location. The attribute accepts values formatted as ISO 639-1 language codes (e.g., en, fr) optionally combined with ISO 3166-1 Alpha-2 country codes (e.g., en-US, fr-CA). Every hreflang implementation must include a self-referencing tag and an x-default fallback for users who don't match any specified language-region pair. Without proper hreflang annotations, Google may display the wrong localized page in search results or flag duplicate content issues across regional domains. We've shipped hreflang across 50+ multilingual projects — it's one of the most misconfigured SEO signals we encounter in audits.

How it works

Hreflang annotations can be placed in three locations: HTML <head> link elements, HTTP headers, or XML sitemaps. The HTML approach is most common:

<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/page" />
<link rel="alternate" hreflang="es-MX" href="https://example.com/es-mx/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page" />

For non-HTML resources (PDFs, for instance), use the HTTP Link header:

Link: <https://example.com/es-mx/doc.pdf>; rel="alternate"; hreflang="es-MX"

The sitemap method scales best for large sites. Inside a <url> entry in your sitemap XML, you add <xhtml:link> elements:

<url>
  <loc>https://example.com/en-us/page</loc>
  <xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/en-us/page" />
  <xhtml:link rel="alternate" hreflang="es-MX" href="https://example.com/es-mx/page" />
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/page" />
</url>

Critical rules: annotations must be bidirectional (if page A references page B, page B must reference page A), every set must include a self-referencing entry, and all referenced URLs must return a 200 status. Broken return links are the single most common hreflang error we see — Google Search Console reports these under the "International Targeting" section. Yandex also recognizes hreflang, but Bing relies on the content-language meta tag instead.

When to use it

Hreflang is essential whenever you have multiple pages targeting different languages or regional audiences with substantially similar content.

Use hreflang when:

  • You operate ccTLDs (e.g., .de, .fr) or subdirectories (/en/, /es/) for different locales
  • You have region-specific pages with different pricing, currency, or legal content (e.g., en-US vs en-GB)
  • You translate or localize blog posts and want each version to rank in the correct regional SERP
  • You have an x-default landing page that auto-detects language and want to prevent it from cannibalizing localized pages

Skip hreflang when:

  • You only publish in one language with no regional variants
  • Your "translations" are machine-generated thin pages with no unique value — fix content quality first
  • You're only targeting Bing — use content-language instead

Our preferred stack for Next.js i18n projects is next-intl combined with programmatic sitemap generation (via next-sitemap) that auto-injects hreflang annotations at build time.

Hreflang vs alternatives

Signal Supported by Placement Best for
hreflang attribute Google, Yandex HTML head, HTTP header, XML sitemap Language + region targeting
content-language meta tag Bing HTML head Language signal for Bing
Accept-Language server-side redirect All crawlers (risky) Server config Auto-redirecting users
Canonical URL Google, Bing, Yandex HTML head Deduplicating same-language pages
Google Search Console International Targeting Google GSC dashboard Country-level targeting for ccTLDs

Hreflang and canonical tags serve different purposes but work together. A localized page should have both: a canonical pointing to itself (not the default-language version) and hreflang annotations pointing to all sibling pages. Conflicting canonicals and hreflang signals — like canonicalizing es-MX to en-US — will cause Google to ignore the hreflang entirely.

Real-world example

We rebuilt an e-commerce client's locale strategy across 8 regional subdirectories (/en-us/, /en-gb/, /de-de/, /fr-fr/, etc.) on Next.js 14 with App Router. Before hreflang implementation, their German pages were showing in US SERPs and their US pages ranked in Germany — both had thin click-through rates below 1%. We generated hreflang annotations via next-sitemap's transform function, producing ~12,000 sitemap entries with bidirectional <xhtml:link> tags. Within 6 weeks of reindexing, Google Search Console showed a 94% reduction in "no return tag" errors. Organic sessions from correctly matched locales increased 38% in the following quarter.

Frequently asked questions about hreflang

Is hreflang the same as the content-language meta tag?
No. Hreflang (`rel="alternate" hreflang="x"`) is a link-level annotation recognized by Google and Yandex that maps specific URLs to language-region pairs. The `content-language` meta tag (or HTTP header) declares the language of the current document and is primarily used by Bing. Google has publicly stated it ignores `content-language` for ranking and indexing purposes. For full coverage across search engines, we typically implement both — hreflang for Google/Yandex and content-language for Bing — though hreflang carries far more weight in practice.
When did hreflang become standard?
Google announced hreflang support in December 2011 on the Google Search Central blog (then called the Google Webmaster Central Blog). It was designed to replace the less reliable signals Google had previously used — like `content-language` and server IP geolocation — for determining page-language targeting. Yandex added support shortly after. By 2013-2014, hreflang was widely adopted by major multilingual sites and became the de facto standard for international SEO targeting on Google. The specification hasn't changed materially since launch, though Google has improved its error reporting in Search Console over the years.
What's the alternative to hreflang?
For Bing, the main alternative is the `content-language` meta tag or HTTP header, since Bing doesn't support hreflang. For Google, there's no direct alternative — hreflang is the only supported mechanism for declaring language-region page relationships. Some teams attempt server-side `Accept-Language` redirects instead, but this is risky: Googlebot typically crawls with `en-US` headers, so it may never see your localized pages. If you can't implement hreflang, at minimum use distinct URL structures per locale, unique title tags, and set country targeting in Google Search Console for ccTLDs or subdirectories.
Does hreflang affect page ranking directly?
Hreflang is not a ranking factor in the traditional sense — it doesn't boost your position for a given query. What it does is ensure the correct regional page appears in the correct regional SERP. Without it, Google might rank your `en-US` page in France instead of your `fr-FR` page, which tanks CTR and sends mismatched signals. Indirectly, correct hreflang implementation improves user engagement metrics (click-through rate, bounce rate) because users land on content in their language. We've consistently seen 20-40% organic traffic lifts in correctly targeted locales after fixing broken hreflang setups.
Get in touch

Let's build
something together.

Whether it's a migration, a new build, or an SEO challenge — the Social Animal team would love to hear from you.

Get in touch →