Hreflang Generator

Create proper language and regional targeting for your multilingual website

Page Information
The URL of the page you're creating hreflang tags for
Alternative Versions

Generated Hreflang Tags

About Hreflang Tags

Hreflang tags tell search engines which language you are using on a specific page, so they can serve the right version to users searching in different languages.

Practical guide: hreflang that actually lines up

What this is

Hreflang annotations declare alternate language or regional versions of a URL so search engines can swap listings toward the best match. They do not translate content; they wire together equivalent pages. Reciprocal references (each page points to the others) and consistent URL sets are critical for the cluster to be trusted. Wrong clusters are worse than no hreflang.

When to implement hreflang

  • You publish true equivalents in multiple languages or country sites (same intent, localized copy/currency).
  • Search Console shows the wrong locale ranking in a market where a better version exists.
  • You maintain en-us and en-gb (or similar) with meaningful regional differences—pricing, spelling, legal.
  • You need an x-default fallback for users outside named locales (language picker or global hub).
  • You are documenting international SEO alongside the broader SEO guide and crawl hygiene.

When not to add hreflang

  • Do not annotate machine-translated stubs that are not ready for users.
  • Avoid pointing every locale at the homepage because “close enough”—only link true alternates.
  • Skip hreflang if you only have one language and use geo-IP redirects without separate URLs.
  • Do not invent regional codes for marketing microsites that are not equivalents of each other.
  • Never combine aggressive geo-blocking with hreflang in a way that prevents Googlebot from fetching alternates.

How to use this generator

List every locale variant of the same content, including a sensible x-default when you have a global fallback. Generate tags, place them in each page’s <head> (or mirror in sitemap with equal care), and verify every URL returns 200 for the intended locale. When a translation is missing, do not invent hreflang to a near-match page—omit or map to a true alternate. Keep canonicals self-referencing per locale unless you have a deliberate cross-locale consolidation strategy.

Worked example

SaaS pricing exists at /pricing (x-default / English global), /us/pricing (en-us), /uk/pricing (en-gb), and /de/preise (de). Each page’s head includes reciprocal hreflang for all four plus self-references. Canonicals point to themselves. Currency and VAT copy differ on US vs UK; German is a full translation—not a thin overlay. After launch, Search Console reports “no return tags” on the UK URL because a CMS plugin stripped hreflang from that template only. Fix: restore the full cluster on UK, re-crawl, confirm the error clears. Do not “solve” it by deleting US tags. For sitemap-based hreflang, keep the same URL set listed in the international sitemap and exclude orphan drafts (sitemap include/exclude).

How to read the results

ISO codes must be valid: language optional plus region, e.g. en-gb. Mixed casing or typos silently weaken clusters. Self-referencing hreflang on each page is required. If Search Console reports “no return tags,” one member of the set is broken or blocked—fix the graph, not a single line. Validate that listed URLs are indexable (not noindex, not disallowed) when you expect them to compete in their markets—see robots / noindex / canonical.

Common mistakes

  • Pointing all locales to the homepage instead of true equivalents.
  • Combining hreflang with geo redirects that prevent Googlebot from seeing alternates.
  • Different canonical targets per locale without a documented strategy.
  • Drift after CMS migrations where old country folders still emit stale tags.
  • Using invalid codes (uk alone instead of en-gb, or invented regions).
  • Listing a URL that 404s or redirects to a non-equivalent page.

QA checklist for an hreflang cluster

  1. Every member lists every other member (and itself) with correct codes.
  2. Each URL returns 200 for the intended locale content—no accidental cross-redirect.
  3. x-default points to the real global chooser or fallback, not a random market.
  4. Canonicals and hreflang do not fight (unless you intentionally consolidate).
  5. Search Console international targeting / hreflang reports show no return-tag errors after recrawl.
  6. Version-control the locale map; retest after every IA or template change.

Related reading

SEO guide · Robots / noindex / canonical · XML sitemaps · Technical hygiene. Related tools: canonical URL, XML sitemap, this generator.

Before / after: return-tag errors after a CMS update

Before: A theme update rendered hreflang only on the “primary” locale template. Secondary locales lost reciprocal tags overnight. Search Console filled with return-tag errors; some markets started surfacing the wrong language.

After: Hreflang moved into a shared head partial fed by a locale map in config. Each deploy runs a smoke test that fetches three locales and asserts reciprocal links. Errors cleared after recrawl. The map lives in version control next to routing rules.

HTML head vs sitemap hreflang

Pick one primary implementation and keep the other in sync if you use both—conflicting sets confuse debugging. Head tags are easier to spot-check on a single URL; sitemaps scale for huge catalogs but demand flawless generation. Either way, every listed URL must be fetchable and equivalent. If a translation is late, omit it from the cluster until it is real.

Benefits of Hreflang Tags

Frequently Asked Questions

What is the difference between language and region codes?
Language codes (e.g., 'en', 'es', 'fr') indicate the language of the content, while region codes (e.g., 'us', 'gb', 'ca') specify the target country or region. You can use both together (e.g., 'en-us', 'en-gb') for more specific targeting.
Where should I place hreflang tags?
Hreflang tags can be placed in the HTML head section of your page, in the HTTP headers, or in your XML sitemap. The most common method is placing them in the HTML head section.
Do I need hreflang tags for every page?
You should add hreflang tags to all pages that have alternative language or regional versions. This includes your homepage and all important content pages that are translated or have region-specific versions.