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
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.
Danish searchers see the Danish page in results — better comprehension, higher conversion, fewer bounces.
Without hreflang, Google may treat translated pages as duplicate content and pick one to rank everywhere.
en-gb, de-at, pt-br — hreflang handles language-region pairs when spelling, currency or legal text differs.
| # | Mistake | Consequence | Fix |
|---|---|---|---|
| 1 | Missing return tags (not reciprocal) | Search engines ignore the whole annotation set. | Every listed URL must link back to every other one, including itself. |
| 2 | No x-default | Users with unmatched languages get an arbitrary version. | Add x-default pointing to your global/English page. |
| 3 | Relative URLs in href | Annotations may be misinterpreted. | Always absolute URLs: https://…. |
| 4 | Wrong language/region codes | Google cannot match users; annotation ignored. | Use ISO 639-1 language + optional ISO 3166-1 Alpha 2 region (da, en-gb). |
| 5 | Listed URLs return errors or redirect chains | Broken targets invalidate the set. | Every hreflang target must return HTTP 200 directly. |
| 6 | Conflicting canonical | A version canonicalising elsewhere contradicts hreflang. | Each version gets a self-referencing canonical. |
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)
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.
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.
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.
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.
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".
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.
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