Hreflang Tag Generator
Serving the right language to the right country starts with correct hreflang tags — and the syntax is unforgiving. Add each version's URL and locale below to generate clean, valid link tags, x-default included.
<head> of every version listed — each page must include the full set, itself included.hreflang only works when it's bidirectional
This is the rule that catches almost everyone. An hreflang annotation is a mutual declaration: if your US page claims the UK page as its British alternate, the UK page must claim the US page right back, and every page must also point to itself. Miss a single return tag and search engines treat the whole cluster as untrustworthy and quietly ignore it. That's why this generator outputs the complete set — including the self-referencing line — to drop into all of your versions, rather than a one-directional snippet that would silently fail in exactly the way that's hardest to debug.
The small mistakes that break it silently
hreflang fails quietly, so the errors are worth knowing by heart. Use en-GB, never en-UK — "UK" isn't a valid country code. The language comes first, the region second, never the other way round. Point hreflang at live, indexable, self-canonical URLs: if a page's canonical tag points somewhere else, or the target redirects or 404s, the annotation is discarded. And don't mix it up with canonical across languages — each language version should be canonical to itself, with hreflang connecting them. Validate in Google Search Console's International Targeting report after you ship.
TrafficBud.io
One snippet is a start. TrafficBud audits your whole site, finds the keywords you're missing, and hands you a monthly SEO plan.
Frequently asked questions
What is an hreflang tag?
An hreflang tag tells search engines which language and region a page is for, so they serve the right version to the right user. It looks like <link rel="alternate" hreflang="en-GB" href="https://example.com/gb/" /> and lives in the page head.
What format does hreflang use?
A language code in ISO 639-1 (like en, es, de), optionally followed by a region in ISO 3166-1 Alpha-2 (like en-GB, es-MX). Use 'en-GB', not 'en-UK' — UK is not the valid country code. Use x-default for the fallback page when no other version fits.
Do hreflang tags need to be on every page?
Yes — hreflang must be bidirectional. Each language version must list all the others and itself (a self-referencing tag). If page A points to B but B does not point back to A, search engines ignore the annotation.