Use hreflang for language and regional URLs

rel="alternate" hreflang="x"

Many websites serve users from around the world with content translated or targeted to users in a certain region. Google uses the rel="alternate" hreflang="x" attributes to serve the correct language or regional URL in Search results.

Creating multi-regional and multilingual sites

Some example scenarios where rel="alternate" hreflang="x" is recommended:

  • You keep the main content in a single language and translate only the template, such as the navigation and footer. Pages that feature user-generated content like a forums typically do this.
  • Your content has small regional variations with similar content in a single language. For example, you might have English-language content targeted to the US, GB, and Ireland.
  • Your site content is fully translated. For example, you have both German and English versions of each page.

Using language annotations

Imagine you have an English language page hosted at, with a Spanish alternative at You can indicate to Google that the Spanish URL is the Spanish-language equivalent of the English page in one of three ways:

  • HTML link element in header. In the HTML <head> section of, add a link element pointing to the Spanish version of that webpage at, like this:

  • HTTP header. If you publish non-HTML files (like PDFs), you can use an HTTP header to indicate a different language version of a URL:
    Link: <>; rel="alternate"; hreflang="es"

    To specify multiple hreflang values in a Link HTTP header, separate the values with commas like so:
    Link: <>; rel="alternate"; hreflang="es",<>; rel="alternate"; hreflang="de"

  • Sitemap. Instead of using markup, you can submit language version information in a Sitemap.

If you have multiple language versions of a URL, each language page must identify all language versions, including itself.  For example, if your site provides content in French, English, and Spanish, the Spanish version must include a rel="alternate" hreflang="x" link for itself in addition to links to the French and English versions. Similarly, the English and French versions must each include the same references to the French, English, and Spanish versions.

You can specify multi-language URLs in the same domain as a given URL, or use URLs from a different domain.



For language/country selectors or auto-redirecting homepages, you should add an annotation for the hreflang value "x-default" as well:

Supported language values

The value of the hreflang attribute identifies the language (in ISO 639-1 format) and optionally the region (in ISO 3166-1 Alpha 2 format) of an alternate URL. For example:

  • de: German content, independent of region
  • en-GB: English content, for GB users
  • de-ES: German content, for users in Spain

Do not specify a country code by itself! Google does not automatically derive the language from the country code. You can specify a language code by itself if you want to simplify your tagging.  Adding the country code after the language to restrict the page to a specific region.  Examples:

  • be: Belarusian language, independent of region (not Belgium French)
  • nl-be: Dutch for Belgium
  • fr-be: French for Belgium 

For language script variations, the proper script is derived from the country. For example, when using zh-TW for users zh-TW, the language script is automatically derived (in this example: Chinese-Traditional). You can also specify the script itself explicitly using ISO 15924, like this:

  • zh-Hant: Chinese (Traditional)
  • zh-Hans: Chinese (Simplified)

Alternatively, you can also specify a combination of script and region—for example, use zh-Hans-TW to specify Chinese (Simplified) for Taiwanese users.

Finally, the reserved value "x-default" is used for indicating language selectors/redirectors which are not specific to one language or region, e.g. your homepage showing a clickable map of the world.

Common Mistakes

Important: Make sure that your provided hreflang value is actually valid. Take special care in regard to the two most common mistakes:

  • Missing confirmation links: If page A links to page B, page B must link back to page A. If this is not the case for all pages that use hreflang annotations, those annotations may be ignored or not interpreted correctly.
  • Incorrect language codes: Make sure that all language codes you use identify the language (in ISO 639-1 format) and optionally the region (in ISO 3166-1 Alpha 2 format) of an alternate URL. Specifying the region alone is not valid.
Example hreflang configuration: Annotations in action

Example Widgets, Inc has a website that serves users in the USA, Great Britain, and Germany. The following URLs contain substantially the same content, but with regional variations:

  • Default page that doesn't target any language or locale; may have selectors to let users pick their language and region.
  • English-language homepage. Contains information about fees for shipping internationally from the USA.
  • English-language; displays prices in pounds sterling.
  • English-language; displays prices in US dollars.
  • German-language version of the content

rel="alternate" hreflang="x" is used as a page level, not a site level, and you need to mark up each set of pages, including the home page, as appropriate. You can specify as many content variations and language/regional clusters as you need.

To indicate to Google that you want the German version of the page to be served to searchers using Google in German, the en-us version to searchers using in English, and the en-gb version to searchers using in English, use rel="alternate" hreflang="x" to identify alternate language versions.

Update the HTML of each URL in the set by adding a set of rel="alternate" hreflang="x" link elements. For the default page that doesn’t target any specific language or locale, add rel="alternate" hreflang="x-default":

<link rel="alternate" hreflang="x-default" href="" />
<link rel="alternate" hreflang="en-gb" href="" />

This markup tells Google's algorithm to consider all of these pages as alternate versions of each other


How helpful is this article:

Feedback recorded. Thanks!
  • Not at all helpful
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful