For international websites, the `hreflang` attribute is a powerful tool for telling search engines which version of a page to show to users in different countries and languages. However, a simple mistake in your language or region codes can render your entire implementation useless. Hreflang language issues, such as using the wrong code or an invalid format, can cause search engines to ignore your signals, leading to a poor user experience and missed SEO opportunities.

Think of your hreflang tags as a set of precise coordinates. If you get one of the numbers wrong, you’ll send your users to the wrong destination. This guide will help you to ensure your coordinates are correct and your international SEO is on the right track. For a broader look at international SEO, see our guide on the localization category.

An illustration showing a user being directed to the correct language version of a page, thanks to accurate hreflang codes.

The Importance of Using Correct ISO Codes

The `hreflang` attribute requires the use of specific, standardized codes to identify languages and regions:

  • Language Codes: You must use the two-letter ISO 639-1 format (e.g., `en` for English, `es` for Spanish).
  • Region Codes: The optional region code must be in the ISO 3166-1 Alpha 2 format (e.g., `GB` for Great Britain, `CA` for Canada).

Common Hreflang Code Mistakes

For a comprehensive guide on implementing hreflang, check out this resource from Moz.

<!-- Incorrect: 'en-UK' is not a valid code --> <link rel="alternate" hreflang="en-UK" href="https://example.com/en-gb/" /> <!-- Correct: Use 'en-GB' for the United Kingdom --> <link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/" />

Finding and Fixing Hreflang Language Issues

The best way to find and fix these issues is to use a website crawler like Creeper. Our tool will audit your entire hreflang implementation and flag any invalid or incorrect codes. This allows you to quickly identify and correct these errors, ensuring that your international SEO strategy is built on a solid foundation. For more on hreflang best practices, see our article on hreflang and canonical tags. It’s also important to include a missing x-default tag.

For Google’s official guidance, see their documentation on localized versions of your page.

Frequently Asked Questions

What are hreflang language issues?

Hreflang language issues occur when you use incorrect or invalid language or region codes in your hreflang tags. This can cause search engines to misinterpret or ignore your international targeting signals.

Can I use a language-only hreflang tag?

Yes. A language-only tag (e.g., `hreflang=”en””`) is perfectly valid and is used to target speakers of that language regardless of their region. You can also have a language-region tag (e.g., `hreflang=””en-GB””`) and a language-only tag (`hreflang=””en””`) in the same set.

What is the correct format for hreflang codes?

You must use the ISO 639-1 format for language codes (e.g., ‘en’, ‘es’, ‘de’) and the ISO 3166-1 Alpha 2 format for region codes (e.g., ‘GB’, ‘US’, ‘CA’). The correct format is ‘language-region’ (e.g., ‘en-GB’), not ‘en-UK’.

Are your hreflang tags speaking the right language? Use Creeper to audit your hreflang implementation and ensure you’re connecting with your global audience.