Hreflang Tags: Managing Multilingual SEO

If your website serves content in multiple languages or targets users in different countries, hreflang tags are essential. They ensure that search engines show the right language version to the right users, preventing confusion and duplicate content issues.

Table of Contents

What Are Hreflang Tags?

Hreflang tags are HTML link elements that tell search engines which language and regional version of a page to display to users based on their location and language preferences. For example, a hreflang tag can indicate that a page has an English version for US users and a separate French version for users in France.

Without hreflang tags, search engines may show the wrong language version to users, leading to high bounce rates and poor user experience. Hreflang also helps prevent duplicate content penalties when you have similar content targeting different regions (e.g., US English and UK English pages with minor spelling differences).

How to Implement Hreflang Tags

Hreflang tags are implemented using the <link rel="alternate" hreflang="xx" href="URL"> format in the head section of your HTML. Each language version must reference itself and all other versions. For a page with English, French, and German versions, each page would have three hreflang tags plus the page itself.

For example, on the English page: <link rel="alternate" hreflang="en" href="https://example.com/en/">, <link rel="alternate" hreflang="fr" href="https://example.com/fr/">, <link rel="alternate" hreflang="de" href="https://example.com/de/">. Every referenced URL must be valid and accessible.

Language and Region Codes

Hreflang uses ISO 639-1 codes for languages (en, fr, de, es, ja) and optional ISO 3166-1 Alpha-2 codes for regions (US, GB, FR, DE). Combine them with a hyphen: en-US for American English, en-GB for British English, fr-FR for French in France, fr-CA for French in Canada.

The language code is always lowercase, while the region code is uppercase. Use the x-default value for your default or fallback page β€” typically a language selection page or the primary international version that does not target a specific region.

Common Hreflang Mistakes

The most common mistake is missing return tags β€” if page A references page B, page B must also reference page A. This bidirectional linking is required for hreflang to work. Another frequent error is using invalid language or region codes, which causes search engines to ignore the tags entirely.

Pointing hreflang tags to non-existent or redirected URLs wastes crawl budget and creates errors. Using hreflang on pages that are noindexed or blocked by robots.txt sends conflicting signals. And forgetting the x-default tag means users with unmatched language preferences may see an inappropriate version.

Best Practices for Multilingual SEO

Use separate URLs for each language version (subdirectories like /en/ and /fr/ are generally recommended). Translate all content, including meta tags, alt text, and structured data. Use the Content-Language HTTP header as an additional signal alongside hreflang tags.

Consider using a sitemap-based approach for large sites β€” hreflang annotations can be placed in the XML sitemap instead of in each page's HTML. This is easier to maintain for sites with many language versions. Monitor hreflang errors in Google Search Console's International Targeting report.

Frequently Asked Questions

What are hreflang tags?

Hreflang tags are HTML attributes that tell search engines which language and regional version of a page to show to users. They use ISO 639-1 language codes and optional ISO 3166-1 Alpha-2 region codes to specify the target audience for each version.

When should I use hreflang tags?

Use hreflang tags when you have content in multiple languages, when you serve different content to users in different countries (even in the same language), or when you have regional variations of the same language (e.g., US English vs UK English).

What is the x-default hreflang value?

The x-default hreflang value specifies the default page to show when no other language or region matches the user's preferences. It is typically used for language selection pages or the main international version of your site.

Related Guides

View all guides →