Technical SEO

Set Up Hreflang (International Sites) — Step-by-Step Guide

Implement hreflang tags correctly for multi-language/region sites to prevent duplicate content and serve the right language.

Hard Medium Impact 1-2 hrs Online Hybrid
Pro Tip

Use the XML sitemap method for hreflang instead of HTML tags if you have many languages. Managing hreflang in the <head> becomes unmaintainable at 10+ languages (each page needs N tags where N = number of languages).

Warning

Hreflang must be bidirectional. If your English page points to the French version, the French page MUST point back to the English page. Missing return tags cause hreflang to silently fail.

Step-by-Step Guide

1

Map all language/region variants of each page

Create a spreadsheet with columns: Page Path, en-US URL, es-ES URL, fr-FR URL, etc. Every page that has translations must have all variants mapped. Pages without a translation in a language should NOT have an hreflang for that language.

2

Add hreflang tags to <head> or XML sitemap

HTML method: Add <link rel="alternate" hreflang="es" href="https://example.com/es/page/"> for each language in every page's <head>. Sitemap method: Add <xhtml:link> elements inside each <url> block. The sitemap method is easier to maintain for many languages.

3

Include x-default for the fallback language

Add <link rel="alternate" hreflang="x-default" href="https://example.com/page/"> pointing to your default language or a language selector page. This tells Google what to show users whose language doesn't match any specific version.

4

Ensure bidirectional references (A points to B, B points to A)

Every hreflang annotation must be confirmed by the target page. If /en/page lists /es/page as the Spanish version, then /es/page must also list /en/page as the English version. Unconfirmed annotations are ignored.

5

Validate with Ahrefs or Screaming Frog hreflang audit

In Screaming Frog: crawl your site, go to Hreflang tab. Check for: missing return tags, inconsistent hreflang values, non-200 hreflang targets, and self-referencing tags. In Ahrefs Site Audit: check the Localization report.

Video Tutorial

AI Prompt

Generate hreflang implementation for my website:

Languages/regions I target:
[LIST: e.g., en-US, es-ES, fr-FR, de-DE]

URL structure:
[subdirectory /en/, subdomain en.site.com, or ccTLD site.co.uk]

Generate:
1. Hreflang tags for a sample page across all my locales
2. x-default tag for the fallback version
3. XML sitemap with hreflang annotations
4. Common mistakes to avoid
5. A validation checklist

Tools & Resources

Hreflang Tag Generator — Aleyda SolisScreaming Frog

Learn More

Hreflang Guide — AhrefsarticleHreflang Documentation — Googleofficial

Do this task in the interactive tool

Track your progress and get guided through every step.

Open Interactive Tool

More in Technical SEO

Enforce HTTPS Sitewide

Easy30 min

Optimize Core Web Vitals

Hard2-5 hrs

Configure Robots.txt Properly

Medium20 min

Submit & Optimize XML Sitemap

Easy20 min

Implement Canonical Tags

Medium30 min

Fix Broken Links & Redirect Chains

Medium1-2 hrs

Mobile-First Optimization

Medium1-3 hrs

Optimize Page Speed

Hard2-4 hrs

Manage Crawl Budget

Hard1-2 hrs

JavaScript SEO & Rendering

Hard2-4 hrs

Implement Structured Data (Schema)

Medium1-2 hrs

Clean URL Architecture

Medium30 min

Security Monitoring & Headers

Medium30 min