CalculatorsConvertersDeveloperTextAll toolsDirectory
Submit your tool Sign in
Theme
Home/Answers/SEO
How-to

How do I add hreflang tags for a site in multiple languages?

Short answer

For each page, add link rel alternate hreflang tags that map every language and region version to its URL, include an x-default for unmatched visitors, and make sure every version carries the same complete set, itself included. This tells search engines which URL to show users in each language. A browser-based hreflang generator builds the whole tag block from your language-to-URL mapping, locally.

What hreflang solves

When the same content exists in English, German and Japanese, search engines need to be told the three URLs are language versions of one page, otherwise users get the wrong language and the versions can compete with each other. Each hreflang tag pairs a language code, optionally with a region like en-GB, with the URL serving that audience, and the x-default entry catches everyone whose language you did not map.

The reciprocity rule

Hreflang only works when the versions agree: every language version of the page should carry the full set of alternate tags, including a tag pointing at itself. If the English page lists the German URL but the German page does not list the English one back, the annotation is inconsistent and search engines may disregard it. Generating the complete block once and pasting the same set into every version is the reliable way to keep them consistent.

Build the block from a mapping

The generator takes your list of language and region codes with their URLs and emits the full set of valid link tags with x-default. Pair it with sensible canonical tags on each version so your language targeting and your duplicate handling point the same way.

Step by step

  1. List your versions. Write down each language or language-region code and the exact URL that serves it.
  2. Generate the tags. Enter the mapping in the hreflang generator and add an x-default URL.
  3. Paste the block into every version. Add the same complete tag set to the head of each language version of the page.
  4. Keep it in sync. When you add a language, regenerate and update the block on all versions.

Frequently asked questions

What is x-default for?

It names the URL to show users whose language does not match any of your listed versions, often a language selector or your primary version.

Does every page version need all the tags?

Yes. Each version should list the complete set of alternates including itself, or the annotations may be ignored as inconsistent.

What do the codes look like?

A language code like en or de, optionally with a region, like en-GB or pt-BR.

Related answers