Hreflang

Hreflang is an HTML attribute that tells search engines which language and regional version of a webpage to show in search results. It helps improve international SEO by serving the right content to the right users.

Hreflang

Hreflang is an HTML attribute used to tell search engines which language and geographical region a specific webpage is intended for. It’s an essential part of international SEO, helping websites deliver the correct language or regional version of a page to users in different locations.

If you operate a website with multiple versions for different languages or countries (e.g., English for the UK, Spanish for Mexico), the hreflang attribute signals to Google which version to show based on the user's language preferences or geographic location.

What does hreflang look like?

Hreflang tags are usually placed in the <head> section of the HTML or included in the sitemap. Here's an example for English (US) and Spanish (Spain) versions of the same page:

<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="es-es" href="https://example.com/es/" />

You can also use a default version as a fallback:

<link rel="alternate" hreflang="x-default" href="https://example.com/" />

Why hreflang matters for SEO

  • Improves user experience by showing content in the user’s language or relevant region.
  • Reduces bounce rates by preventing users from landing on a page in the wrong language.
  • Prevents duplicate content issues by telling search engines that similar pages are intended for different audiences.
  • Boosts visibility in local search results, helping each version rank in its target market.

Without hreflang tags, search engines might not know which version to show, leading to lower rankings, poor targeting, or incorrect content being served.

Common hreflang values

LanguageRegionHreflang Code
English (Global)en
English (United States)USen-us
French (France)FRfr-fr
Spanish (Mexico)MXes-mx
German (Germany)DEde-de

A full list of codes can be found in Google’s hreflang documentation.

Best practices for hreflang implementation

  • Always include a self-referencing hreflang tag for each page.
  • Use hreflang consistently across all alternate versions.
  • Avoid using hreflang with redirects or canonical tags pointing to different URLs.
  • Validate your hreflang setup using tools like Google Search Console’s International Targeting report or Ahrefs Site Audit.
  • Use x-default for generic landing pages that don’t target a specific language or region.

In summary, hreflang is a powerful SEO attribute that ensures search engines serve the right version of your content to users based on language and location. It’s a must-have for websites targeting multilingual or international audiences, helping improve user experience and maximize search visibility across markets.

Free SEO Tools

Simple, powerful tools to help you improve your website's SEO performance

SERP Checker

Enter your website and keyword to see where you rank in Google search results.

Try it free →

SEO Checker

Analyze your website's SEO and get actionable tips to improve.

Try it free →

Keyword Rankings

Discover all the keywords your website is already ranking for on Google.

Try it free →