HomeServicesResultsThe SignalFree ToolsAboutContactFree Audit

Hreflang Implementation: The Complete Technical Guide

Hreflang errors are the most common international SEO mistake. This technical guide covers every implementation method, edge case, and debugging technique.

Hreflang is deceptively simple in concept — tell Google which language and country version of a page to show to which users — but notoriously difficult to implement correctly at scale. Google's own documentation estimates that over 75 percent of hreflang implementations contain errors. At Growth Nuts, we have debugged hreflang issues for sites ranging from 5 to 50 language versions, and the common thread is that small implementation mistakes create big indexing problems.

Hreflang Basics

Hreflang annotations use the format language-country, following ISO 639-1 for language codes and ISO 3166-1 Alpha 2 for country codes. The language code is required; the country code is optional. Use language only — like hreflang en — when content is language-specific but not country-specific. Use language-country — like hreflang en-gb — when you have country-specific versions of the same language content.

Three Implementation Methods

HTML Link Elements

Add hreflang link tags in the head section of each page. Each tag references one alternate version, and the page must reference itself as well. This method is straightforward for sites with a small number of language versions but becomes unwieldy for sites with many versions — a page with 20 language versions needs 20 link tags in the head of every page.

HTTP Headers

For non-HTML content like PDFs or when you cannot modify the HTML head, use HTTP Link headers to specify hreflang annotations. The syntax is similar to the HTML method but delivered through HTTP response headers. This method is useful for content delivered through APIs or for file types that do not support HTML head elements.

XML Sitemap

Declare hreflang annotations in your XML sitemap using the xhtml:link element within each URL entry. This method is recommended for large sites with many language versions because it centralizes hreflang management and avoids bloating the HTML head. Sitemap-based hreflang is also easier to generate and maintain programmatically.

Key Insight

For sites with more than five language versions, sitemap-based hreflang implementation is almost always the most maintainable approach. It separates hreflang management from page templates and makes bulk updates straightforward.

The Return Tag Requirement

Every hreflang annotation must be confirmed by a return tag on the referenced page. If page A declares page B as its French version, page B must declare page A as its English version. Missing return tags — called orphaned hreflang annotations — cause Google to ignore the annotation entirely. This is the single most common hreflang error and the most impactful.

The x-default Value

The x-default hreflang value designates the page that should be served when no other hreflang annotation matches the user's language or country. Typically this is your primary language version or a language-selection page. Always include an x-default value in your hreflang annotations — without it, Google must guess which version to show to users in unmatched regions.

Debugging Hreflang Issues

  1. Use Ahrefs or Check Google Search Console's International Targeting report for hreflang errors Validate hreflang annotations manually for a sample of key pages using the hreflang tag checker tool Verify that all referenced URLs are indexable — canonicalized, non-redirecting, non-noindex pages Confirm that canonical tags on alternate pages point to themselves, not to another language version Test that hreflang annotations are consistent across all three possible implementation methods Common Mistake

    Never set a canonical tag on a language-specific page pointing to a different language version. Each language version should self-canonicalize. Cross-language canonical tags tell Google to ignore the alternate version entirely, defeating the purpose of hreflang.

    Maintaining Hreflang at Scale

    Automate hreflang generation from your CMS or content management system. Map relationships between content versions in your database and generate hreflang annotations programmatically. Run automated validation checks weekly to catch new errors as content is added or URLs change. Treat hreflang as an ongoing technical maintenance task, not a one-time implementation.

    Ready to Improve Your SEO?

    Get a free audit and actionable recommendations for your business.

    Get in Touch
    GN
    Growth Nuts Team
    SEO Experts