International SEO has a reputation for being intimidating, and hreflang tags are usually the reason. Missing return links, wrong country codes, conflicting signals… one tiny mistake and Google starts showing the wrong language version to your users. The good news? Hreflang is not as scary as it looks. In this guide, we will walk you through everything you need to set up hreflang tags correctly, with real examples and the most common pitfalls to avoid.
What Are Hreflang Tags?
Hreflang tags are HTML attributes that tell search engines the language and geographical targeting of a page. When you have multiple versions of the same content (for different languages or regions), hreflang helps Google serve the right version to the right user.
For example, if a French user from Canada searches for your product, hreflang ensures they land on the French-Canadian page (fr-CA), not the French-French one (fr-FR).
Why Hreflang Matters for International SEO
- Prevents duplicate content issues across language variants
- Improves user experience by showing the correct version in SERPs
- Consolidates ranking signals between equivalent pages
- Reduces bounce rates from users landing on the wrong locale

How Hreflang Tags Look in Practice
A basic hreflang tag in the <head> section of a page looks like this:
<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
<link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Each tag points to an alternate version of the page. The x-default tag specifies the fallback version for users whose language or region does not match any of the listed variants.
Step-by-Step: How to Implement Hreflang Tags Correctly
Step 1: Map Out Your Language and Region Versions
Before touching any code, list every language and regional variant of your website. Create a simple spreadsheet with the URL of each version and its target audience.
| URL | Language | Region | Hreflang Code |
|---|---|---|---|
| example.com/ | English | Global | x-default |
| example.com/us/ | English | United States | en-us |
| example.com/fr/ | French | France | fr-fr |
| example.com/es/ | Spanish | Spain | es-es |
Step 2: Use the Correct Language and Country Codes
This is where many SEOs slip up. You must use:
- ISO 639-1 for language codes (e.g.,
en,fr,es) - ISO 3166-1 Alpha 2 for country codes (e.g.,
US,FR,GB)
Common mistakes include using en-uk instead of en-gb, or es-la for Latin America (which is not a valid country code).
Step 3: Choose Your Implementation Method
You have three options to implement hreflang tags:
- HTML tags in the head: Best for small to medium static sites.
- HTTP headers: Ideal for non-HTML files like PDFs.
- XML sitemap: The cleanest method for large multilingual sites, easier to maintain and less prone to errors.
Example: Hreflang in an XML Sitemap
<url>
<loc>https://example.com/us/</loc>
<xhtml:link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<xhtml:link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />
</url>
Step 4: Add Return Tags on Every Page
This is the rule most SEOs forget: every page in the hreflang cluster must reference all the others, including itself. If page A links to page B, but page B does not link back to page A, Google will ignore the annotation entirely.
Step 5: Add the x-default Tag
The x-default tag tells Google which page to show when no other language or region matches. This is typically your global homepage or a language selector page. While not mandatory, it is strongly recommended.
Step 6: Validate Your Implementation
Use these tools to verify everything is working as expected:
- Google Search Console: Check the International Targeting report
- Screaming Frog: Crawl your site to detect missing or broken hreflang references
- Ahrefs Site Audit or Semrush: Find hreflang conflicts at scale
- Merkle Hreflang Tags Testing Tool: Validate individual URLs

The Most Common Hreflang Mistakes (and How to Fix Them)
| Mistake | Why It Breaks | Fix |
|---|---|---|
| Missing return tags | Google ignores the annotation entirely | Ensure bi-directional linking between all variants |
| Wrong country code (en-uk) | Invalid ISO code, tag ignored | Use en-gb for United Kingdom |
| Using underscores (en_US) | Hreflang requires hyphens | Replace _ with – |
| Pointing to non-canonical URLs | Creates conflicting signals | Always reference canonical, indexable URLs |
| Mixing absolute and relative URLs | Some crawlers misinterpret paths | Always use absolute URLs with full protocol |
| No self-referencing tag | Cluster is considered incomplete | Each page must reference itself |
Hreflang and Canonical Tags: How They Work Together
Hreflang and canonical tags must agree, not conflict. Each language variant should have a self-referencing canonical tag, not a canonical pointing to another language version. If you canonicalize your French page to your English one, Google will drop the French version from its index and hreflang signals will be wasted.

Hreflang for Specific Scenarios
Same Language, Different Regions
If you have en-us, en-gb, and en-au versions, hreflang helps Google distinguish them even though the language is identical. This is especially useful for ecommerce sites with different pricing or shipping options per country.
Multiple Languages, One Domain
Whether you use subdirectories (/fr/), subdomains (fr.example.com), or ccTLDs (example.fr), hreflang works the same way. Just make sure your URL structure is consistent.
Pages That Do Not Have a Translation
Do not force a hreflang link to a page that does not exist in that language. Only include alternates that have a real, equivalent translated version.
Final Checklist Before You Hit Publish
- All hreflang codes use valid ISO 639-1 and ISO 3166-1 Alpha 2 formats
- Every page references itself and every alternate
- Return tags are in place on every page in the cluster
- An x-default tag is included
- All URLs are absolute and canonical
- No conflicts between hreflang and canonical signals
- Implementation validated through Search Console and a crawler
FAQ About Hreflang Tags
What are hreflang tags in simple terms?
Hreflang tags are small pieces of HTML code that tell search engines which language and region a page is meant for, so users see the right version in search results.
What is an example of a hreflang tag?
A typical example is: <link rel="alternate" hreflang="fr-ca" href="https://example.com/fr-ca/" /> which tells Google this is the French version for users in Canada.
How do I add hreflang tags to my website?
You can add them in the HTML head of each page, in HTTP headers, or in your XML sitemap. For large sites, the XML sitemap method is the easiest to maintain.
Do I need hreflang if my site is only in one language?
No. Hreflang is only required when you have multiple language or regional versions of the same content.
Does hreflang help with SEO rankings?
Hreflang does not directly boost rankings, but it ensures the right version of your page ranks in the right country, which improves CTR, user experience, and reduces duplicate content issues.
What is the x-default tag used for?
The x-default tag indicates the fallback page to show when no other language or region matches the user’s preference, typically a global homepage or language selector.
Wrapping Up
Hreflang does not need to be intimidating. Once you understand the logic of bi-directional references, valid codes, and canonical alignment, it becomes a structured, repeatable process. Take it one step at a time, validate your work, and your international SEO setup will be solid. If you need help auditing your hreflang implementation or building an international SEO strategy, our team at Wicked SEO is here to help.