If you have a website in multiple languages or targeting different countries, hreflang tags are essential. Without them, Google often chooses the wrong version of your page to show to users in different regions — or worse, sees your pages as duplicate content and filters some out of the index entirely.

What Is Hreflang?

Hreflang is an HTML attribute that tells Google which language and regional audience a particular page is intended for, and which other pages are the equivalent content in other languages or regions.

A hreflang tag looks like this in the of your page:

``html `

Every page in the set must include the full set of hreflang tags — including a reference to itself.

The x-default Tag

The hreflang="x-default" tag tells Google which page to show when no other language/region variant matches the user. This is typically your main language page or a language selector landing page.

Missing x-default is one of the most common hreflang errors.

Common Hreflang Errors

Missing return links — If page A references page B in its hreflang set, page B must reference page A back. Missing return links cause the entire hreflang relationship to be ignored. Invalid language codes — Language codes must follow BCP 47 format. "en-GB" is valid; "english" is not. Country codes must be uppercase (GB, US, FR); language codes must be lowercase (en, fr, de). Missing x-default — Every hreflang set should include an x-default tag. Pointing to non-200 URLs — If any URL in your hreflang set returns a redirect or 404, Google ignores the entire relationship. Inconsistent URL formats — Mixing trailing slashes, HTTP/HTTPS, or www/non-www variants in your hreflang tags causes them to fail.

Hreflang in XML Sitemaps

For large sites, managing hreflang in HTML can be complex. An alternative is to define hreflang relationships in your XML sitemap using the ` element. This is equivalent to the HTML approach and easier to manage at scale.

When You Don't Need Hreflang

You only need hreflang if you have genuinely different content for different languages or regions. If you're an English-only site targeting one country, you don't need it.

Similarly, if you have the same content in both US and UK English with no meaningful differences, consider whether you actually need separate pages. The SEO overhead of maintaining a full hreflang implementation may not be worth it for minor regional differences.

Auditing Your Hreflang Implementation

Run a hreflang checker to validate: - All return links are in place - Language and region codes are valid - x-default is present - All URLs in the hreflang set return 200 status - No redirect chains within the hreflang set

Common CMS platforms like WordPress (with plugins like Polylang or WPML) handle hreflang automatically — but the implementation still needs auditing because plugin configurations vary and errors are common.