hreflang Tags Explained: A Practical Guide for Multilingual Sites

Your multilingual pages are live, indexed, and getting impressions—then you notice French searchers landing on the Dutch URL, or users in one country bouncing because they hit the “wrong” version. That’s the problem hreflang is meant to solve: it tells Google which URL matches which language (and optionally which region) when you publish near-identical pages across multiple URLs.

The catch is that hreflang is easy to get “almost right.” Google treats it as a hint, not a command, and it can ignore your annotations when the set is incomplete or the details don’t line up. A wrong language/region code, missing return links, or URLs that redirect are enough to waste the work—and hreflang won’t boost rankings anyway. It mainly helps the right version show up for the right searcher and reduces mismatched landings.

This guide sticks closely to Google Search Central’s localized versions (hreflang) documentation and translates it into a practical checklist: when to use hreflang, how to pick ISO 639-1 language codes and optional ISO 3166-1 alpha-2 regions, what “correct” sets look like (self-references, reciprocal links, and x-default), and how to implement consistently via HTML, HTTP headers, or sitemaps. If you want to move faster, Balzac’s free generator at https://hirebalzac.ai/free-seo-tools/hreflang-generator/ runs in the browser and builds head link tags from a list (it doesn’t fetch your pages); the full tool hub is https://hirebalzac.ai/free-seo-tools/. Balzac writes articles in 46 languages.

When Should You Use Hreflang (and When You Shouldn’t)?

Google’s localized-versions guidance is clear about the intent of hreflang tags: use them when you publish multiple URLs that are near-identical in content but meant for different languages or regions. If you do not have distinct language or country URLs, hreflang usually creates more ways to be wrong than right.

Use this quick checklist before you add the hreflang attribute anywhere.

  • You have separate URLs per audience. Example: /en/ and /fr/, or example.com/ and example.be.
  • Those pages target different users by language or region. The content can be translated or lightly localized (currency, spelling, shipping rules).
  • Each version should appear in search for its audience. You actually want Google to choose between variants.
  • You can maintain a complete set. Every variant must reference every other variant, including itself (you will implement this in the next section).

If those conditions match your site, hreflang helps Google pick the right URL for the searcher. Victorious, an SEO agency, describes hreflang as a signal that helps Google factor language and location into which page shows in search results, and it is a signal rather than a directive (Victorious hreflang guide).

When Hreflang Is Unnecessary or Risky

Skip hreflang when you only have one version of a page. Skip it when you rely on automatic translation overlays that keep a single URL and swap text client-side, because Google still sees one address to index.

Be careful with hreflang when your “variants” are not real alternatives. If your country pages differ by product availability, legal restrictions, or pricing rules, you might need separate content strategies, canonical tags, and internal linking decisions, not a blanket hreflang rollout.

Hreflang becomes risky when you cannot keep it clean. Ahrefs studied 374,756 domains using hreflang and found 67% had at least one issue (Ahrefs hreflang study). The common pattern is simple: teams add tags once, then URLs change, redirect, or get noindexed. If you cannot commit to maintaining the mapping, do not ship hreflang yet.

How to Choose the Right Language and Region Codes

Most hreflang tags break because someone picked the wrong code. Google expects a language code, and it optionally accepts a region code. If you mix those up, your mapping can look “valid” to a human and still get ignored.

A hreflang value has two parts:

  • Language in ISO 639-1 format (two letters), for example en, fr, nl.
  • Region (optional) in ISO 3166-1 alpha-2 format (two letters), for example BE, CA, CH.

Write them as language-REGION, for example fr-BE. Keep the language in lowercase and the region in uppercase for readability and consistency. Google’s rules and examples live in Google Search Central’s localized versions documentation.

Common Code Mix-Ups That Break Hreflang Tags

The classic mistake is using a country code where a language code should go. DreamHost gives a clean example: Greek language is el, Greece region is gr (DreamHost). That means:

  • Use hreflang="el" for Greek-language pages.
  • Use hreflang="el-GR" for Greek-language pages targeted specifically to Greece.
  • Avoid hreflang="gr", because gr is not a language code.

Pick a region code only when you truly have different URLs for that region, like separate pricing, legal terms, shipping rules, or spelling conventions that justify a distinct page. If your French page works for Belgium, France, and Canada, stick to fr and keep the hreflang set smaller and easier to maintain.

How to Build a Correct Hreflang Set (Self-Reference, Return Links, x-default)

A smaller set of variants is easier to maintain, but every variant still needs a complete hreflang mapping. A “correct hreflang set” means each page lists every alternate URL for that page, including itself, using the exact link rel="alternate" hreflang syntax Google supports.

Use this base pattern in the HTML <head> (same syntax shown by Search Atlas):

  • <link rel="alternate" hreflang="-" href="">

Example Hreflang Tags Set With Self-Reference, Return Links, and x-default

Say you have three URLs for the same page: English, French, and a generic selector page. Put the full set on each language URL.

On https://example.com/en/

  • <link rel="alternate" hreflang="en" href="https://example.com/en/"> (self-reference)
  • <link rel="alternate" hreflang="fr" href="https://example.com/fr/">
  • <link rel="alternate" hreflang="x-default" href="https://example.com/">

On https://example.com/fr/

  • <link rel="alternate" hreflang="en" href="https://example.com/en/"> (return link)
  • <link rel="alternate" hreflang="fr" href="https://example.com/fr/"> (self-reference)
  • <link rel="alternate" hreflang="x-default" href="https://example.com/">

Google calls hreflang a way to signal localized versions of a page, and it expects reciprocal annotations (return links) across alternates. Keep Google’s rules close while implementing: Google Search Central’s localized versions documentation.

Use hreflang x-default for the “fallback” URL when no language or region fits, often a language selector or a global homepage. Search Atlas describes x-default as the version Google can select when the browser shows no language or country data (Search Atlas).

Which Hreflang Implementation Method Should You Use?

Your hreflang tags only work if Google can reliably find the full set for every variant, including your x-default fallback. Google supports three implementation methods for hreflang: HTML, HTTP headers, and XML sitemaps (Search Atlas). Pick one method and use it consistently across the site. Mixed implementations are hard to audit and easy to break during migrations.

  • HTML head (most common): Add <link rel="alternate" hreflang="..." href="..."> tags in the <head> of each HTML page. Use this when you control templates (WordPress themes, Shopify Liquid, custom apps) and your pages are regular HTML documents.
  • HTTP header: Send hreflang annotations in the HTTP response headers. Use this for non-HTML files that can rank in Google, like PDFs, or when you cannot edit the document content but you can edit server responses (for example, via Nginx or Apache config).
  • XML sitemap: Declare alternates inside your sitemap. Use this when you manage hreflang centrally, your site has many variants, or your CMS makes head edits painful. This is also a clean option for headless setups where a separate SEO system generates sitemaps.

How to Choose the Right Hreflang Implementation Method

Use this decision order:

  1. If the URL is HTML and you can edit templates, use HTML head. It keeps the hreflang set next to the page it describes, which makes reviews and debugging faster.
  2. If the URL is a document (PDF) or another non-HTML asset, use HTTP headers. You cannot rely on a <head> that does not exist.
  3. If you need one place to manage every mapping, use an XML sitemap. Treat it like a source of truth, then automate updates when URLs change.

Whichever method you choose, keep the basics intact: every variant must list every alternate, include a self-reference, and point to final, indexable URLs. Google’s rules and examples live in Google Search Central’s localized versions documentation.

Hreflang Mistakes Google Commonly Ignores

Most hreflang tags fail for boring reasons: Google crawls the URLs you reference, finds conflicts, then ignores the annotations. Fix these issues before you ask Google to recrawl, because broken hreflang sets tend to stay broken as URLs change.

  • Missing return links (reciprocal annotations). If page A points to page B, page B must point back to page A with the matching hreflang value. Fix by generating the full set for every variant and deploying it everywhere it belongs. Confirm in Google Search Console’s URL Inspection that Google can crawl each variant.
  • Missing self-referencing hreflang. Ahrefs found 18% of domains had pages missing self-references. Fix by adding a rel="alternate" entry for the current page on the current page, for every variant URL.
  • Invalid language or region codes. Google expects ISO 639-1 language codes and (optionally) ISO 3166-1 alpha-2 region codes, as documented in Google Search Central’s localized versions guidance. Fix by auditing values like gr (region) mistakenly used as a language, then correcting to valid pairs such as el or el-GR.
  • Hreflang URLs that redirect, 404, or otherwise fail. Ahrefs reports 16.9% of domains reference redirected or broken pages. Fix by updating hreflang to the final, canonical, indexable URL. Do not point hreflang at a geo-redirecting URL that bounces users based on IP.
  • Hreflang URLs blocked from indexing. Google can ignore annotations when the target URL has noindex, sits behind auth, gets blocked by robots.txt, or canonicalizes to a different page. Fix by making every alternate page indexable and aligning canonicals with hreflang targets.

How to Recheck After Fixes

Re-crawl a sample set with a crawler like Screaming Frog SEO Spider (hreflang extraction), then request reindexing for updated pages in Google Search Console. Keep one implementation method sitewide, and keep the hreflang set identical across every variant.

Generate Hreflang Tags Faster With Balzac’s Free Tool

Screenshot of workspace Balzac

Keeping the hreflang set identical across every variant is where teams lose time. The syntax is simple, but the busywork adds up when you map dozens of URLs, add self-references, and include an hreflang x-default fallback.

If you want to generate hreflang tags quickly without crawling your site, use Balzac’s free hreflang generator. It runs in the browser, builds HTML head link rel="alternate" tags from a list you paste in, and it does not fetch pages. That makes it a good fit when you already trust your final URLs and you want clean markup for templates, a CMS, or a deployment ticket.

How to Use the Hreflang Generator Without Creating New Errors

  1. Export your final, indexable URLs. Use the “200 OK” destination URLs, not redirecting ones, and avoid any URL you plan to noindex.
  2. Group true alternates together. Each group should represent the same page in different languages or regions, plus an optional x-default URL.
  3. Paste the mapping and generate the head tags. Review that each page includes a self-referencing hreflang and reciprocal return links across the set.
  4. Implement in one place. If your site uses HTML head annotations, publish the generated tags through your templates and keep that method sitewide.

If you want more utilities for audits and implementation work, browse the broader collection in Balzac’s free SEO tools hub.

Once you publish the tags, recrawl a sample set and fix any return-link gaps before you scale the rollout. Balzac writes articles in 46 languages.

Sources

← All articles

Free AI visibility check

Is ChatGPT citing your site?

See if ChatGPT search and Google AI Overviews cite you for your top searches, and who they cite instead. About a minute, no account.

Want content like this on autopilot?

Balzac researches, writes and publishes articles like this one to your site. Every week.

3 free articles · No card needed