INTERNATIONAL SEO · HREFLANG · GUIDE

Hreflang Guide:
How to Implement and Check Language Targeting

Hreflang tells Google which language version of your page to show in which country. Get it wrong and Danish users land on your English page (or worse, nothing ranks). Here is how the annotation works, which mistakes are most common, and how to check a whole site automatically.

Updated August 2026 · 5 minute read

What hreflang does

A hreflang annotation is a line in the page <head>:

<link rel="alternate" hreflang="en" href="https://example.com/page">
<link rel="alternate" hreflang="da" href="https://example.com/da/page">
<link rel="alternate" hreflang="x-default" href="https://example.com/page">

Together these three lines say: English speakers get the first URL, Danish speakers get the second, and everyone else gets the x-default. Each version should also carry a self-referencing canonical URL.

🌍 Right users, right version

Danish searchers see the Danish page in results — better comprehension, higher conversion, fewer bounces.

📑 Translations are not duplicates

Without hreflang, Google may treat translated pages as duplicate content and pick one to rank everywhere.

🎯 Region variants supported

en-gb, de-at, pt-br — hreflang handles language-region pairs when spelling, currency or legal text differs.

The 6 most common hreflang mistakes

#MistakeConsequenceFix
1Missing return tags (not reciprocal)Search engines ignore the whole annotation set.Every listed URL must link back to every other one, including itself.
2No x-defaultUsers with unmatched languages get an arbitrary version.Add x-default pointing to your global/English page.
3Relative URLs in hrefAnnotations may be misinterpreted.Always absolute URLs: https://….
4Wrong language/region codesGoogle cannot match users; annotation ignored.Use ISO 639-1 language + optional ISO 3166-1 Alpha 2 region (da, en-gb).
5Listed URLs return errors or redirect chainsBroken targets invalidate the set.Every hreflang target must return HTTP 200 directly.
6Conflicting canonicalA version canonicalising elsewhere contradicts hreflang.Each version gets a self-referencing canonical.

Check a multilingual site automatically

The free, open-source page-profile CLI audits the <head> of any URL — canonical, hreflang alternates, meta robots, titles:

npx page-profile https://example.com/da/page        # single page report
npx page-profile --urls-from-file urls.txt          # batch all language versions (Pro)
Get page-profile free →

Frequently asked questions

What is hreflang?

Hreflang is an HTML attribute (<link rel="alternate" hreflang="...">) that tells search engines which language and region version of a page to show to which users. If your site exists in English and Danish, hreflang helps Google serve the Danish page to Danish searchers and the English page to everyone else.

Does hreflang affect SEO rankings?

It does not boost rankings directly, but it routes the right users to the right version — which improves engagement and conversions in each market. It also prevents duplicate-content confusion between translated pages, so the correct version ranks in each locale instead of Google guessing.

Is hreflang required to have x-default?

Not required, but recommended. The x-default value tells search engines which URL to show users whose language matches none of your versions — typically your global or English page. Every complete hreflang set should include it.

Do hreflang tags need to be reciprocal?

Yes. If page A lists page B as its alternate, page B must list page A back. Missing return tags are the single most common hreflang error and cause search engines to ignore the entire annotation set.

Should hreflang be used together with canonical?

Yes — they work together. Each language version should have a self-referencing canonical AND point to its alternate versions via hreflang. The canonical says "this is the authoritative URL for this version"; hreflang says "these other URLs are equivalent versions for other languages".

Where do I put hreflang tags?

Three places work: the <head> of each page (most common), an XML sitemap with xhtml:link entries, or HTTP headers (for non-HTML files like PDFs). Pick one method and use it consistently — mixing methods risks conflicts.

How do I check my hreflang implementation?

Inspect the <head> of each page for <link rel="alternate"> tags and verify every listed URL returns 200 and links back reciprocally. For more than a few pages, a CLI tool like page-profile automates the head-tag audit across your whole sitemap.

Related: Canonical URL Guide · SEO Metadata Audit · Technical SEO Check