Quick answer. Hreflang tells search engines which language and region version of a page to show. Use valid ISO language and optional region codes, include a return tag on every URL, add an x-default fallback, and keep each page canonical to itself. Generate HTML, HTTP header or sitemap annotations and validate them before you deploy.

International SEO fails in quiet ways. A UK visitor lands on a US English URL. A German page canonicalises to the English original and never quite gets indexed. Two language versions forget to point back at each other, so the annotations are ignored. Hreflang is the signal that prevents those mistakes, but only if the cluster is complete, the codes are valid, and the canonical tags do not contradict it. This guide is a practical way to build that cluster in 2026, using the Hreflang Tag Generator and the Canonical and Pagination Tag Builder together.

The normative reference is Google’s documentation on localized versions and hreflang. What follows is how to apply it on a real site without turning the sitemap into a knot.

When you actually need hreflang

You need hreflang when the same content, or very close variants of it, is served on different URLs for different languages or language-region combinations. Typical cases are a site with /en/, /en-gb/ and /de/ folders, a ccTLD pair such as example.co.uk and example.com.au, or a shop that changes currency and legal copy by country. You do not need hreflang for a single-language site that simply mentions other countries, and you should not use it as a cheap substitute for a proper redirect when one URL has permanently replaced another.

If the pages are not interchangeable for a human — for example a UK blog post that does not exist in French — do not invent a hreflang pair. Annotate only the URLs that are genuine alternates of each other, plus an x-default URL that can catch unmatched languages.

Codes, return tags, and x-default

Language codes are ISO 639-1 (en, de, fr). Optional regions are ISO 3166-1 alpha-2 (GB, US, AU). Optional scripts, such as zh-Hans and zh-Hant, follow ISO 15924. A frequent typo is en-UK. The United Kingdom’s region code is GB, so the correct tag is en-GB. The generator on this site will warn about that class of error before you copy the markup.

Every URL in a set must list the full set, including itself, and every other URL must point back. That reciprocity is what people mean by return tags. If /de/pricing points to /en/pricing but the English page does not point back, Google may ignore the annotation. x-default is the fallback for users whose language you do not explicitly cover, often a language chooser or your primary international English URL. Include it as its own row and keep it consistent across the cluster.

URLs in hreflang annotations must be absolute, including the scheme. Relative paths such as /de/pricing are a common reason a carefully written block does nothing. The Hreflang Tag Generator asks for absolute URLs for that reason and can default the x-default URL to the first row if you do not set one.

Worked example: four versions of a pricing page

A software company publishes:

  • https://example.com/pricing — international English, also used as x-default
  • https://example.com/en-gb/pricing — UK English, GBP, VAT-inclusive copy
  • https://example.com/de/pricing — German, EUR
  • https://example.com/fr/pricing — French, EUR

You add one row per URL in the generator, tick “Include x-default”, and set the x-default URL to the international English page. The tool outputs three artefacts you can choose from: HTML <link rel="alternate" hreflang="…"> tags for the document head, an HTTP Link header for cases where you cannot edit HTML, and an XML sitemap block that uses xhtml:link alternates. Pick one primary implementation method and keep it. Mixing a partial HTML block with a different, incomplete sitemap cluster is how annotations go stale.

Paste the HTML onto all four pages, or paste the sitemap block into the sitemap entries for all four URLs. Then generate a self-referencing canonical for each page with the Canonical and Pagination Tag Builder. The German page’s canonical should be the German URL, not the English one. Hreflang and canonical must agree: alternates are peers, not duplicates you are trying to hide.

Canonical tags, pagination, and language versions

This is the conflict that causes the most damage. A localisation plugin or a well-meaning “consolidate duplicates” rule points every language back to the English canonical. Search engines then see a cluster that claims “these are alternates” and a canonical that claims “there is only one real page.” In practice the non-English URLs struggle.

The safe pattern is simple. Each language or language-region URL is canonical to itself. Tracking parameters are stripped from that canonical. Paginated lists in a given language point to the correct language-specific page numbers, not to page 1 in another language. Use the canonical builder to strip parameters such as utm_source and to produce rel="prev" and rel="next" only inside the same language series, remembering that Google has said it no longer uses prev/next as an indexing signal — they can still help humans and some other crawlers, but they will not rescue a bad canonical.

Google’s guides on canonical URLs and pagination are worth reading next to the hreflang document, because international sites usually have all three problems on the same templates.

HTML, HTTP headers, or a sitemap?

HTML link tags are the easiest to inspect: view source and you can see the cluster. They work well on pages you control end to end. HTTP Link headers are useful for non-HTML files or when a CDN can inject headers without a full HTML deploy. Sitemap annotations scale better when you have thousands of locale pairs and you already generate the sitemap from the same inventory as the site. They are also easier to get wrong if the sitemap still lists redirected or noindexed URLs.

Whichever method you choose, regenerate the annotations in the same release as a new locale or a slug change. A hreflang sitemap that still points at last year’s URLs is worse than no annotations, because it advertises a broken cluster. After a slug change, 301 the old URL to the new one in the same language, then remove the old URL from the hreflang set entirely. Do not leave a redirected URL as a hreflang target.

A validation pass before you ship

Run the cluster through the Hreflang Tag Generator and read the validation panel, not only the copy buttons. Confirm there are no en-UK style codes, no relative URLs, no missing return tags, and an x-default that exists. Then spot-check the live pages: each URL returns 200, is not noindexed, and shows a self-canonical. If a language version is still in staging, do not add it to the production cluster.

In Search Console, the International Targeting or hreflang-related reports (where available for your property) and the URL Inspection tool are the after-deploy checks. Look for unmatched language clusters and for URLs in the sitemap that are not the final destination. Because this domain may still be awaiting Search Console verification, treat the generator’s validation and your own live-source checks as the gate you can run today.

Hreflang will not translate a thin page into a good one, and it will not fix a site that serves the same English document on four “locale” URLs. It rewards careful inventory. Keep that inventory small, complete, and in agreement with your canonical tags, and the annotations will do the quiet job they were designed to do. When you add a fifth language later, treat it as a full cluster rebuild: every existing page gains one new return tag, the new page lists the whole set, and the sitemap or HTML block is regenerated in the same release.

Frequently asked questions

No. The language-region combination for British English is en-GB, because the ISO region code for the United Kingdom is GB, not UK. A generator that flags this typo will save you a cluster Google cannot use.

Yes. x-default is an extra fallback URL, not a substitute for reciprocity. Every language or region URL in the set must list the full set, including itself and the x-default, and those pages must point back.

Almost never, if the German page is a genuine alternate you want indexed. Each language version should use a self-referencing canonical. Use hreflang to connect the peers, not a canonical that collapses them into one URL.

Pick one primary method and keep it complete. HTML is easiest to inspect on small sites. Sitemaps scale when you already generate them from the live inventory. Headers help when you cannot edit the HTML. Avoid two partial, conflicting clusters.

No. Every annotation should point at a final URL that returns 200 and is indexable. After a slug change, redirect the old address and rebuild the cluster so it only contains the new absolute URLs.