Fix Hreflang Errors in 5 Minutes: The Free Generator + Checklist

Woman working intently on her laptop at a desk while auditing a website's international SEO setup
Photo by Zulfugar Karimov on Unsplash

You've built a site with a US page and a UK page, or an English version and a Spanish version of the same product page. Then you notice something odd in Search Console: Google is showing your Spanish page to searchers in Madrid, but also occasionally to searchers in Mexico City who'd be better served by a page with Mexican pricing and spelling. Or worse, your US and UK pages are quietly competing with each other, and Google is only ever showing one.

This isn't a content problem. It's a signal problem — Google has no way to know these pages are intentional, region-specific counterparts of each other unless you tell it. That signal is called hreflang (sometimes written href lang, or referred to loosely as langhref), and despite its reputation, it's simpler to implement correctly than most explanations make it sound. The reputation, though, is earned: even Google's own Search Advocate has called this one of the trickier corners of technical SEO, and the data on real-world implementations backs that up.

67%
of hreflang implementations across a 374,756-domain study had at least one error
3
valid ways to declare it — HTML tags, HTTP headers, or an XML sitemap
1
missing return tag is enough to invalidate an entire cluster
"Hreflang is one of the most complex aspects of SEO — if not the most complex one. Feels as easy as a meta tag, but it gets really hard quickly." — John Mueller, Google Search Advocate
Quick Answer

Hreflang (also written href lang) is an HTML attribute that tells search engines which language and region a page is written for, so the right localized version of a page can be shown to the right searcher. It's added as link tags in the page head, an HTTP header, or an XML sitemap, and every page in a set must link back to every other page, including itself, for it to be considered valid.

Key takeaways
  • Hreflang routes searchers to the right language/region page — it is not a ranking factor by itself.
  • Every page in a cluster must link back to every other page, including itself, or Google may discard the whole set ("return tag" rule).
  • Codes follow the format language-COUNTRY, e.g. en-GB, using ISO 639-1 and ISO 3166-1 standards.
  • Hreflang can be declared in HTML tags, an XML sitemap, or an HTTP header — sitemaps scale best for large or frequently updated sites.
  • Bing treats hreflang as a weak signal; Google treats it as strong. Don't rely on it as your only international signal.

What is hreflang?

Hreflang is an annotation that pairs a page's URL with a language and, optionally, a region code. It exists to solve one specific problem: when the same content is published in multiple languages or for multiple countries, search engines need a way to know those pages are alternates of each other rather than duplicate or unrelated content. You'll see it referred to a few different ways in the wild — hreflang, href lang (as two words), or even shorthand like langhref — but they all point to the same attribute.

Below is a single hreflang entry broken into its three working parts — the relationship it declares, the language and region it targets, and the URL it points to.

<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
rel="alternate"

Marks this as an alternate version of the current page — the same instruction used for AMP pages or print stylesheets, just applied to language instead.

hreflang="en-GB"

The language and region this specific URL is written for: English, targeted at Great Britain. This is the part that actually routes the searcher.

href="..."

The full, absolute URL of the page being described — not the page the tag lives on, but the destination it's pointing to.

Four things are worth understanding clearly before implementing anything:

Put simply: hreflang isn't a tag you add to one page. It's a relationship you declare across a whole cluster of pages at once — which is exactly what makes it easy to get subtly wrong, and exactly why that 67% error rate exists in practice rather than in theory.

Why hreflang matters

Skipping hreflang on a multilingual or multi-region site has consequences that are easy to miss until they show up in traffic data:

📊 Quick stat The single most common reason Google Search Console flags an "Alternate page with proper canonical tag" or missing-return-tag warning on international sites isn't a wrong language code — it's one page in the cluster that simply forgot to link back to the others.

How Google actually processes hreflang

It helps to think of hreflang less as a tag and more as a cluster map. Google crawls each URL in a set independently, reads its list of alternates, and only accepts the cluster as valid once every page's list agrees with every other page's list. The diagram below shows a healthy three-page cluster next to a broken one where a single missing link invalidates the whole group.

Valid versus broken hreflang return-tag clusters VALID CLUSTER en-US en-GB en-AU BROKEN CLUSTER en-US en-GB en-AU en-AU links out, but nothing links back to it
Left: every page in the cluster links to every other page and back — a valid set. Right: en-AU is referenced by the other pages but never returns the favor, so Google discards the annotation for that URL.

A few mechanical details follow from this model:

Google vs. Bing: is hreflang treated the same way?

This is worth separating out because it changes how much weight to put on hreflang depending on which search engine you're optimizing for. Google treats a correctly implemented hreflang cluster as a strong signal for routing searchers to the right localized page. Bing does not weight it nearly as heavily.

Google Strong signal

Hreflang is a well-documented, actively supported signal. Return tags, x-default, and valid ISO codes are all checked, and errors are surfaced directly in Search Console's International Targeting report.

Bing Weak signal

Bing has publicly described hreflang as a weak signal for its systems, leaning more on a page's actual content language, server or hosting location, and explicit country-targeting settings to decide what to serve.

The practical takeaway: implement hreflang correctly for Google, but don't rely on it as your only international signal. Clear on-page language, consistent <html lang> attributes, and straightforward URL structure (subfolders or ccTLDs per region) still matter for engines that treat hreflang as secondary.

Step-by-step: implementing hreflang

  1. Map out your page groups. List every set of pages that are the same content in different languages or for different regions — this is the cluster hreflang will connect.
  2. Choose an implementation method. Decide between HTML link tags in the page head, an HTTP header (useful for PDFs or non-HTML files), or entries in your XML sitemap.
  3. Assign the correct codes. Use the ISO 639-1 language code alone for language-only targeting, or add the ISO 3166-1 country code when a page is region-specific, such as de versus de-AT.
  4. Add a full set of tags to every page. Each page in the cluster needs a complete list of alternates, including a self-referencing tag pointing to itself.
  5. Include an x-default entry. Point it to a sensible fallback, such as a language-selector page or your primary international version.
  6. Use absolute, canonical URLs. Every href value should be the full URL, including protocol, and should match the canonical version of that page exactly.
  7. Match the HTML lang attribute to the hreflang value. A page whose visible content is declared as one language shouldn't carry a self-referencing hreflang entry for a different one.
  8. Validate before and after publishing. Check the tags with a hreflang validator, then confirm in Google Search Console's International Targeting report that no return-tag errors appear.

Here's what a complete, valid three-page cluster looks like once every step above has been applied — this is the exact block that would go on each of the three pages, with only the self-referencing entry order changing:

HTML — placed in <head> of every page in the cluster
<link rel="alternate" hreflang="en-US" href="https://example.com/us/" /> <link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" /> <link rel="alternate" hreflang="en-AU" href="https://example.com/au/" /> <link rel="alternate" hreflang="x-default" href="https://example.com/us/" />

Notice that the US page includes an entry pointing to itself — that self-reference is what most implementations forget, and it's required, not optional.

Try the Rebrixe Hreflang Generator — free Add your page groups and language codes, get complete, return-tag-safe hreflang markup.
Generate Hreflang Tags →

Common mistakes that break hreflang

These account for the large majority of hreflang errors flagged in Search Console and by third-party site audit tools — each is small on its own, but any one of them can invalidate an entire cluster.

1

Missing return tags

If Page A lists Page B as an alternate but Page B doesn't list Page A back, search engines treat the whole annotation for that pair as untrustworthy and typically ignore it entirely.

2

Using the wrong or reversed code format

The format is always language-COUNTRY, such as en-US, never US-en or a country code used alone — a country isn't a substitute for a language in this syntax, and codes that aren't valid ISO 639-1 / ISO 3166-1 values get ignored outright.

3

Conflicting with the canonical tag

Pointing a page's canonical tag at a different-language version while also hreflang-linking to it sends a contradictory signal — the canonical should point to itself when hreflang is being used to manage translated variants.

4

Using relative URLs

Hreflang href values need to be complete, absolute URLs with the protocol included; relative paths are a frequent cause of validator errors and silently ignored tags.

5

Forgetting to update the cluster when a page is added

Launching a new regional version means every existing page in that cluster needs its hreflang list updated to include the new page — otherwise the new version won't be linked back to properly.

6

Declaring the same language for more than one URL

A single page's hreflang set should reference one URL per language (or language-region pair) at most — pointing hreflang="en" at two different pages from the same source page is a direct contradiction that gets the whole set discarded.

7

Mismatched HTML lang and hreflang values

When a page's <html lang="..."> declaration doesn't match the language it uses to reference itself in hreflang, that inconsistency undermines confidence in the whole annotation for that page.

💡 Pro tip Keep a single source-of-truth spreadsheet mapping every URL to its language and region code, so any hreflang cluster can be regenerated in full whenever a page is added, moved, or removed.

Why IP-based redirects aren't a substitute

A common workaround people reach for instead of hreflang is auto-detecting a visitor's country from their IP address and redirecting them straight to the matching regional page. It's tempting because it feels automatic, but it causes two real problems.

The safer pattern is to let hreflang (or explicit visible links to alternate versions) do the routing for search engines, and — if you still want to nudge human visitors toward a better-matching page — use a small, dismissible banner suggesting the alternate version rather than a forced redirect. It should stay unobtrusive enough that it doesn't function as an interstitial blocking the page.

Real-world examples

Hreflang looks different depending on how a site is structured — by subfolder, by subdomain, or by fully separate domain. Here's how the same underlying signal plays out across four common site setups, with the actual URL pattern each one uses.

Global ecommerce store · subfolders
Region-specific pricing pages
en-US / en-GB / en-AU
store.com/us/shoes, /uk/shoes, /au/shoes — same product copy, different currency and shipping details, linked so each country sees its own version in search.
SaaS company · subdirectories
Translated marketing pages
en / de / fr / ja
saas.com/de/pricing style paths — fully translated landing pages linked as language alternates, with x-default pointing to the English version.
Multilingual blog · sitemap-based
Per-post language pairs
Declared in sitemap.xml
Hreflang declared in the XML sitemap instead of page templates, since posts are added faster than templates get edited — no per-post HTML changes needed.
News publisher · ccTLDs
Regional editions
en-IN / en-US / en-GB
news.in, news.com, news.co.uk — same English-language story, three regional editions, hreflang prevents the editions from cannibalizing each other's rankings.

The pattern across all four: hreflang isn't compensating for a translation problem, it's managing a routing problem — getting an already-correct page in front of the right person, regardless of whether that site uses subfolders, subdomains, or entirely separate domains.

Hreflang implementation methods compared

Three valid ways to declare hreflang, and where each one is the more practical choice.

Method Setup effort Best for Watch out for
HTML link tags Moderate, per page Small to mid-size sites with templated pages Return tags must be kept in sync across every page
XML sitemap Low, centralized Large sites, frequently added content, blogs Sitemap must be regenerated whenever pages change
HTTP header High, server-level Non-HTML files like PDFs Requires server or CDN configuration access

A sitemap entry for the same three-page cluster used earlier looks like this — one <url> block per page, each carrying the full set of alternates:

XML sitemap — one block, works for the whole cluster
<url> <loc>https://example.com/us/</loc> <xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/us/"/> <xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/uk/"/> </url> // repeat as its own <url> block for /uk/, listing both entries again

Generate your hreflang tags right now — free

The Rebrixe Hreflang Generator builds a complete, return-tag-safe set of hreflang link tags for every page in your cluster, including x-default. No account, no watermark — enter your URLs and language codes, and copy the finished markup.

Free Hreflang Tag Generator Add your pages and codes, copy the complete tag set.
Open Hreflang Generator →

Frequently asked questions

Hreflang tells search engines that several pages are translated or localized versions of the same content, so the correct version can be shown to a searcher based on their language and region instead of Google guessing.
No. Hreflang only matters when the same content exists in more than one language or in region-specific versions, such as English for the US and English for the UK. A single-language, single-region site has nothing for hreflang to disambiguate.
x-default marks the fallback page to show visitors whose language or region doesn't match any of the specific hreflang entries, typically a language-selector page or a default global version of the site.
Hreflang is only valid when every page in a set points back to every other page, including itself. If Page A links to Page B but Page B doesn't link back to Page A, Google treats the whole annotation as unreliable and may ignore it.
Yes. Hreflang can also be declared in an XML sitemap or in the HTTP header of a response, which is useful for non-HTML files or for sites where editing page templates individually isn't practical.
Hreflang is not a ranking factor by itself. What it changes is which version of a page gets shown to which searcher, which improves relevance and click-through rate rather than boosting a page's position for everyone.
Hreflang uses ISO 639-1 two-letter language codes, optionally combined with an ISO 3166-1 Alpha-2 country code, written as language-COUNTRY, such as en-GB for English in the United Kingdom or fr-CA for French in Canada.
Google Search Console's International Targeting report flags missing return tags and invalid codes, and third-party hreflang validator tools can crawl a full set of URLs at once to confirm every page links back correctly.
No. Bing has stated that hreflang is a weak signal for its systems and that it relies more heavily on other on-page and technical cues, such as content language, server location, and explicit country-targeting settings, to decide which version of a page to serve.
No. Automatic IP-based redirects are unreliable and can prevent search engines from crawling every regional version of a site properly, which Google treats as a form of cloaking if crawlers are redirected differently than users. Hreflang, visible alternate links, or a small non-intrusive language suggestion banner are the recommended approaches instead.

Generate your hreflang tags in seconds

The Rebrixe Hreflang Generator builds a complete, return-tag-safe set of hreflang markup — no account, no watermark, just a ready-to-paste tag set for every page in your cluster.

Launch the Hreflang Generator →
← Back to blogs