Skip to content
WebInsights

Hreflang that does not lie: only the locales you ship

You have hreflang when each language pair exists — not when the plugin has written a tag.

Hreflang is a language pair, not a tag you paste on every page. If /en/ does not exist, or x-default points at a 404, you have asked Google to guess.

13 min read
Stylised browser window with two language tabs, only the locales that actually render paired as hreflang sisters — not a guessed /en/ path.

SEO & web

If you are searching for hreflang, or for hreflang errors, you are typically in one place: Search Console shows 'hreflang error', Google shows the wrong locale, or you pasted da-DK and en on every page and called it 'we are bilingual'. The canonical post is choosing one URL for this page. The sitemap post is the list of URLs you want found. The JSON-LD post is markup that mirrors HTML. The relaunch post is the cutover map. This one is the pair. Hreflang says: this page has a real translation there. If 'there' is a 404, a different article, or a path you guessed by swapping /da/ for /en/, you do not have hreflang. You have a tag that lies.

Google treats hreflang as a hint about language and region — and as a requirement that the pair is reciprocal. DA must point at EN, and EN must point back at DA, and both must point at themselves. x-default is the fallback for someone who matches none of the locales you ship — not 'English, because that is international', unless you mean that. A plugin that writes three locales when you only have two is three votes. The crawl guesses. The guess is rarely the page you translated.

TL;DR

The main takeaways

  • Hreflang is a reciprocal language pair. If the other URL does not render, the tag is a lie you asked Google to trust.
  • Each page points at itself and at the locales that actually exist — not at a guessed /en/ path you never shipped.
  • x-default is the fallback for unmatched languages, not a synonym for English unless you chose that.
  • Canonical is the address of this locale. Hreflang is the sister. The two must not be swapped.
  • The canonical post is one URL. The sitemap is the list. JSON-LD is the script. Relaunch is cutover. This one is the pair.
  • You have hreflang when you can open each pair and see the same article in the language the code promises. Not when the generator ran.

Why this matters at all

A bilingual site that points DA at EN, and EN at a 404, does not have 'international SEO'. It has an annotation the crawl learns to ignore. On a young domain, trust in your signals is what you cannot afford to waste. Every wrong sister is a vote against the right ones: canonical, sitemap, internal navigation. Three truths and one lie is still an argument.

Teams do it because the first generator 'worked'. The WordPress plugin turned hreflang on. Next.js `alternates.languages` mapped `/da/` to `/en/` on every slug. Nobody checked whether the EN route exists. Nobody checked whether EN is the same article, or a different landing you happened to give the same slug. Three months later Search Console shows 'no return-tag', 'unknown language', and the Danish page appears for English queries because the pair was never a pair.

The damage is concrete. The wrong locale in the index. A user who lands on EN and gets a DA canonical. An x-default that points at the homepage, so every unmatched language gets the homepage instead of the article you had. A sitemap that lists EN sisters the HTML does not know — two votes the sitemap post already warned about. The canonical post is that a locale must not canonicalise to the other locale. This one is that hreflang must not invent the other locale.

We write this because 'we have hreflang' has become a checkbox you tick when the source contains `hreflang`. An honest setup is boring: only locales you render, reciprocal tags, self-ref, an x-default you chose, the same truth in HTML and sitemap. Without that choice you have a tag. You do not have a language pair Google can use.

What hreflang actually is — and what a language tag is not

Hreflang is a declaration: this URL is the Danish version, that URL is the English version of the same document, and here is the fallback. ISO language code, optional region. `da` or `da-DK` if you mean Denmark. `en` if you mean English without promising the US. The difference is not whether the attribute parses. The difference is whether each URL in the set returns 200 with the article you claim is the translation.

It is not the same as canonical. Canonical says: of these duplicates of this locale, show this one. Hreflang says: this locale has a sister. A DA page that canonicalises to EN has not chosen. It has surrendered the Danish URL. The canonical post is one address per document-in-one-language. This one is that two languages are two documents that point at each other — not one document with two URLs.

It is also not the same as `lang` on `<html>`. `lang` is the page you are on. Hreflang is the map to the others. You can have a correct `lang="da"` and still point at an EN sister that does not exist. The JSON-LD post is the script that must mirror visible HTML. This one is that the link elements must mirror the routes you actually render.

And it is not 'the more locales, the better'. A site that ships DA and EN, and lists `de`, `sv`, `no` because 'we are considering it', has listed 404s as sisters. The sitemap post is that the list must not invent sisters. HTML hreflang is the same rule, closer to the crawl. Do not invent a language you have not written.

What typically goes wrong when someone says hreflang is set

The first failure is guessing the path. `/da/indsigter/foo` becomes `/en/insights/foo` in a string replace, even when EN never got that slug, or when the English section is named something else. Next.js `alternates.languages` is the pen. You are the editor. If the EN route is not in the data source, it must not be in the map. A generator that 'just swaps the locale prefix' is how no-return-tag becomes your weekly report.

The second failure is forgetting self-ref and the return tag. DA points at EN. EN does not point back. Or neither points at itself. Google has documented this for years: the set must be complete and reciprocal. A plugin that only prints 'the other languages' on the page you are on has forgotten the URL the crawl is on. That is not a detail. It is half of the contract.

The third failure is mixing canonical and hreflang. DA `rel=canonical` points at EN, 'so we do not have duplicates'. Then you have said the Danish page is not a document. You have a language you hid. The canonical post is variants of the same locale (www, slash, UTM). Two languages are not variants. Two languages are two canonical URLs that know each other via hreflang.

The fourth failure is an x-default you did not choose. The plugin points x-default at EN because 'internationals'. Your buyers are Danish. Unmatched languages get the English brochure you never maintained, instead of DA. Or x-default points at `/`, which 307s to `/da/` — a hop the redirects post already hates. x-default is a URL you will show a French speaker who has no FR page. Choose it. Do not guess it.

A real language pair vs. a tag you are hoping for

The honest pair

Only locales that render. Reciprocal tags. Self-ref. An x-default you chose. The same truth in HTML and sitemap.

  • Each URL in the set returns 200 with the same article in the promised language
  • DA points at EN and itself; EN points at DA and itself
  • Canonical is this locale; hreflang is the sister — they are not swapped
  • Is boring to maintain, because it comes from the same data source as the routes

The hoped-for tag

Plugin on, /en/ guessed, x-default on the homepage, and three languages you are considering.

  • String-replace /da/ to /en/ without checking that the route exists
  • No return tag, no self-ref, or canonical to the other locale
  • An x-default you never chose, or a URL that redirects
  • Is an argument in Search Console you call international SEO
hreflang-alternates.tsts
// Right: only locales that actually render, plus self-ref
const languages = { "da-DK": daUrl, en: enUrl, "x-default": daUrl };
// Wrong: guess /en/ from /da/, and list languages you have not written
// languages.de = daUrl.replace("/da/", "/de/");

How to decide what may sit in hreflang — before you generate the tag

Without this order you get another tag you call a language pair.

  1. 01

    Write which locales exist, as a list you can point at

    Not 'we are international'. DA and EN, if that is what you render. If a slug only exists on DA, there is no pair. Then there is no hreflang to a sister — only self-ref, or drop the annotation. The sitemap post is membership on the list. This one is membership in the pair.

  2. 02

    Generate from the same data source as the routes, not from a string replace

    Next.js `alternates.languages`, a CMS field, a plugin you configured — the pen changes. If the EN route cannot render, it must not be in the map. A function that replaces `/da/` with `/en/` on every path is how 404s become sisters.

  3. 03

    Make the set reciprocal, and point at yourselves

    Each page in the pair carries the whole set: itself, the sister, x-default. Open DA, read the tags. Open EN, read the tags. They must be the same URLs. A missing return tag is the error Search Console refuses to forget.

  4. 04

    Keep canonical on this locale

    DA canonicalises to DA. EN to EN. Hreflang is the bridge. The canonical post is www, slash and UTM. This one is that you do not 'fix duplicates' by hiding one language under the other. Two canonical URLs. One pair.

  5. 05

    Choose x-default on purpose, and check that it does not redirect

    Typically the locale you will show unmatched languages — often DA on a Danish site, or a language-picker URL you actually have. Not a hope of EN. Not `/` that 307s. The redirects post is the hop. x-default must be a 200 you will stand behind.

“You have hreflang when each language pair exists — not when the plugin has written a tag.”

HTML, sitemap, x-default and region — the same words, four jobs

The HTML link in `<head>` is the job most Next.js and WordPress sites should own. It is close to the page. The crawl sees it with the document. Pick one place as truth. If you also set the HTTP `Link` header, it must say the same thing. Two different sets are two votes. The JSON-LD post is script versus visible text. This one is annotation versus route.

Sitemap alternates are the job the sitemap post already cut: the same truth as HTML, only locales that exist. A sitemap that lists the EN sister the page does not point at is the fourth failure there and the first here. Generate both from the same map. Do not guess in one and be honest in the other.

x-default is the job you either choose or drop. It is not required. It is useful when you have a URL for 'we do not know which language'. On a DA-first site that is often DA. On a site with a language picker it is the picker — if it 200s and is not a redirect carousel. Pointing x-default at EN 'because business' without maintaining EN is sending unmatched users into the locale you forgot.

Region codes are the job you should only use when you mean it. `da-DK` and `da` are not the same signal, but you do not need both. `en-GB` and `en-US` are two pages if you have written two. A site with one English brochure should use `en`, not three region variants that all point at the same URL — unless you are deliberately saying one URL covers them. The canonical post is one URL. This one is that three region tags on one URL is a promise you must be able to defend.

What you should typically do in the situation you are in

The left is what you typically say. The right is the next step we typically recommend.

  • Situation

    Search Console shows no return-tag or hreflang errors on DA/EN pairs

    Next step

    Open both URLs. The set must be identical and reciprocal, with self-ref. Fix the generator, not the report

  • Situation

    Hreflang points at /en/ paths that 404 or are a different article

    Next step

    Only locales that render the same document. A string replace is not a pair

  • Situation

    DA canonicalises to EN 'to avoid duplicates'

    Next step

    Two languages, two canonicals. Hreflang is the bridge. The canonical post is variants of the same locale

  • Situation

    x-default points at / or at EN you do not maintain

    Next step

    Choose the 200 unmatched languages may land on. Often DA on a Danish site. Never a hop

  • Situation

    Sitemap alternates and HTML hreflang are two different sets

    Next step

    Same data source. Two votes are the argument the sitemap post already described

Checklist before you call it hreflang

If you are missing several of these, the sentence is we have hreflang — the setup is a tag you are hoping for.

  • Each URL in the set returns 200 with the same article in the language the code promises
  • The set is reciprocal and includes self-ref — DA and EN carry the same URLs
  • Canonical is this locale; hreflang is the sister; they do not point across each other as 'the real page'
  • x-default is chosen on purpose and 200s — or the field is omitted
  • HTML and sitemap say the same thing, from the same data source as the routes
  • Canonical is the address. The sitemap is the list. JSON-LD is the script. Relaunch is cutover. This one is the pair

Questions we get again and again

  • Is this the same as canonical URL, sitemap or JSON-LD?

    No. The canonical post is choosing one address for this locale and 301 on the rest. The sitemap is the list of URLs you want crawled. JSON-LD is the script that must mirror visible HTML. Relaunch is the cutover map. This one is the language pair: this DA URL has that EN URL as a real translation. You can have one canonical host and still point hreflang at 404s. You can have an honest list and HTML tags that guess /en/. Four jobs. One does not replace the others.

  • Should every page have hreflang, including the ones that only exist in Danish?

    Only if there is a pair. A page that only exists on DA does not have an EN sister. Inventing one is listing a 404. Self-ref alone is allowed, but it says nothing the crawl does not already know. Drop the sister until you have translated. A plugin that 'always prints both' is how no-return-tag and 404 sisters become your default.

  • Is x-default required?

    No. It is a signal to unmatched languages. Useful when you have a URL you will show them. On a DA-first site that is often DA. It is not a synonym for English. An x-default that redirects, or points at a locale you do not maintain, is worse than none. Choose a 200, or omit the field.

  • What about a WordPress plugin versus Next.js alternates.languages?

    The job is the same: only locales that render, a reciprocal set, self-ref, canonical on this locale, an x-default you chose. The plugin or the metadata function is the pen. If the pen replaces a prefix and assumes every slug exists in every language, it writes it wrong. Configure include. Check five pairs in the browser. Do not let 'all published posts in all languages' be SEO without you having opened the sister.

  • May DA canonicalise to EN if the English page is the 'master'?

    No, not if you want the Danish URL in the index. Canonical to EN says DA is not a document. Then you have a language you hid, and an hreflang tag fighting canonical. Two languages, two canonicals, hreflang between them. The canonical post is duplicates of the same locale. Master language is an editorial choice. It is not a canonical strategy.

If hreflang is a tag you call a language pair

Let us separate a boring pair from a generator you are hoping for.

Only the locales you actually ship beat a plugin that guesses /en/.

Why we wrote this

This is how we think — and it's what we build.

Our insights are about the work we actually do. If this hit something you're working on, there's a concrete service that lines up.