serps.io
All free tools

Technical

Hreflang Tag Generator

A reciprocal set, not five half-done ones

In build

Enter your URLs and their languages and get the full set of link rel=alternate tags, each page referencing every other and itself, with region codes in the right format, an x-default row, and the HTTP header and sitemap versions of the same set.

Get early access

What it returns

  • A link rel=alternate block for every URL in the set, where each page lists every other page and itself.
  • Language and region values in the format the spec expects: language first, region optional, and none of the invented codes that silently invalidate an entry.
  • An x-default entry for the page that serves everyone you did not target, which is the row hand-written sets omit most often.
  • The same set expressed as HTTP Link headers and as sitemap xhtml:link entries, for the templates and file types where tags in the head are not available.

When this matters

A retailer runs five country sites and the German pages keep ranking in the United Kingdom. The annotations are all present, but each page points outward without being pointed back at, so the cluster is discarded entirely: hreflang is only honoured when the references are reciprocal. Generating the whole matrix at once, instead of editing five templates by hand and missing one, is the difference between a set that is used and a set that is ignored.

How to answer this today

Site audit checks the cluster you already have: it crawls each version, parses the annotations, and reports the pages whose references are not returned, whose codes are invalid, or that have no x-default. That catches a broken set in production. Writing the set for a market you are about to launch is the step before it.

Site audit

Why this is harder than it looks

Reciprocity is all or nothing

If page A names page B and B does not name A, the annotation is dropped rather than half applied. Hand-maintained sets break the first time a page is added, because the new page needs a line on every page that already exists.

Codes are not country codes

The language comes first and the region is optional, the region is not where the office is, and common guesses are simply invalid values. One wrong code invalidates that entry, which quietly changes which version a market is shown.

It has to agree with your canonicals

A page that canonicalises to a different language version cancels its own annotation, because the cluster then points at a URL that disclaims itself. Both sets of tags have to be generated from the same map of the site.

It is a hint, not a redirect

Hreflang tells a search engine which version to show which audience. It does not stop the wrong version ranking, it does not consolidate signals between versions, and it does nothing for a visitor arriving from a link. Expecting it to behave like geo-routing leads to the wrong fix.