Hreflang Tag Generator

Generate hreflang tags for multilingual SEO. Add language and country combinations with URLs.

Language 1

How to use the Hreflang Tag Generator

hreflang tells Google which language and region each version of a page targets. Done right, it serves the correct version to each user. Done wrong, it's the leading cause of multilingual site indexation problems.

1

List every language/region version

For each version of the page, add the URL plus the language code (en, fr, de) or language-region code (en-US, en-GB, fr-CA). Use ISO 639-1 for language and ISO 3166-1 Alpha 2 for region.

2

Add x-default (recommended)

x-default tells Google which version to serve when no language match exists. This is usually your English or homepage version. Always include it for global sites.

3

Generate bidirectional tags

Critical: every version of the page must reference every other version, including itself. /en references /fr; /fr references /en; both reference each other. Missing references break the entire cluster.

4

Place tags consistently

Three placement options: in the page <head>, in the HTTP Link header, or in the sitemap.xml. Pick one and stick with it. Mixing placements causes Google to ignore the tags.

Why hreflang is critical for multilingual SEO

Without hreflang, Google often ranks the wrong language version for a user — German searchers get the English page, US users get the UK page. hreflang fixes this, but it's also the most error-prone tag in technical SEO. A 1% error rate on a site with 5,000 pages and 4 languages = 200 broken clusters.

The bidirectional rule

Every version of a page must declare every other version, including itself. If /en/about declares only /fr/about, Google treats the cluster as broken and ignores the hreflang signal entirely. Use a tool to generate and validate the full bidirectional set — manual editing across dozens of languages is where most bugs live.

Language code, region code, or both?

Five common hreflang failures

Frequently asked questions

What is hreflang?

hreflang is an HTML attribute (or HTTP header / sitemap directive) that tells search engines which language and optionally which region a page targets. It's used on multilingual or multi-regional sites to ensure Google serves the correct version of a page to each user.

Where should I place hreflang tags?

Three options: in the page <head> as <link rel="alternate" hreflang="..." href="...">; in the HTTP Link header (for non-HTML files); or in the sitemap.xml. Pick one placement and stick with it across the entire site. Mixing placements causes Google to ignore the tags.

What's x-default?

x-default is a special hreflang value that tells Google which page to serve when no language match exists for the user's locale. Typically this is your default English or international homepage. Recommended for all multilingual sites with global audiences.

Why is my hreflang not working?

The most common causes: (1) missing self-reference — every page must list itself in its hreflang block; (2) bidirectional mismatch — page A references page B but page B doesn't reference page A; (3) URL points to a 404 or redirect; (4) hreflang and canonical conflict (canonical points to a single page while hreflang declares multiple alternates). Google ignores broken clusters entirely.

Do I need hreflang for the same language across countries?

Yes, if the content actually differs (US English vs UK English with different currency, spelling, products). Use en-US and en-GB codes. If the content is identical and you just want both to rank, skip hreflang and let Google rank the canonical version.

Want AI-generated blog content that ranks? Try Autorank free.

Get Started Free →