Hreflang tags tell search engines which version of a page to show to users in different languages or countries. Without them, Google may show your UK page to Australian visitors or your German page to Austrian users who expect different prices. Hreflang is simple in principle but easy to get wrong, so here is how it works with examples.
1The Basic Syntax
Each hreflang annotation names a language, optionally a region, and the URL of that version, for example: link rel=alternate hreflang=en-GB pointing to the UK page, hreflang=en-AU pointing to the Australian page, and hreflang=de-DE pointing to the German page. Language codes use ISO 639-1 (en, de, fr) and region codes use ISO 3166-1 Alpha-2 (GB, AU, DE).
2Rules That Must Be Followed
- Every page lists all its alternates, including itself
- Annotations must be reciprocal (return tags)
- Use full, canonical, indexable URLs
- Use ‘en-GB’, not ‘en-UK’ (UK is not the ISO code)
- Add x-default for visitors who match no version
3Where to Implement Hreflang
You can add hreflang in the HTML head, in HTTP headers (useful for PDFs), or in your XML sitemap. For large sites, sitemaps are often easiest to maintain. In Next.js, the alternates.languages field in metadata generates the tags.
4Common Mistakes
Missing return tags, pointing hreflang to redirected or noindexed URLs, mixing canonical tags that point to another language, wrong codes, and only adding hreflang to the home page. Each of these can cause Google to ignore your annotations.
5How to Test
Crawl the site with an SEO crawler that validates hreflang, check international targeting reports, and search from different countries using a VPN to confirm the right version appears.
Frequently Asked Questions
Is hreflang a ranking factor?
Hreflang does not boost rankings directly; it helps Google show the correct version to the right audience, which improves relevance and conversions.
Do I need hreflang if I only have one language?
No, unless you have separate versions targeting different countries in the same language.
What is x-default?
An hreflang value for the fallback page shown to users whose language or region does not match any specific version.
Can hreflang and canonical tags conflict?
Yes. Each language version should canonicalise to itself, not to another language version.
Want This Done for You?
Adkode helps businesses in India, Australia and Europe with seo services. Get a free audit and a clear plan.
Get a Free Audit