Small SEO Tools

How to Add Hreflang for Language and Regional Pages

A translated article can be accurate while the connections between its versions are missing. If you have an English guide, a Hindi translation and an English edition for India, first map those pages. Then generate the annotations and check the published result. This walkthrough uses a fictional bread-making guide with three URLs.

Start with equivalent pages, not whole websites

Google recommends separate URLs for different language versions. Keep each page readable in its intended language and provide visible links so readers can switch versions. Avoid automatic language redirects that prevent access to another edition. These points come from Google guidance on multilingual sites.

For our example, all three pages explain the same basic recipe. The Hindi edition translates the instructions. The India edition uses locally familiar ingredient names and shopping examples. A contact page or an unrelated recipe does not belong in this group.

Edition Example URL Hreflang
General English https://example.com/en/bread-guide/ en
General Hindi https://example.com/hi/bread-guide/ hi
English for India https://example.com/en-in/bread-guide/ en-IN

These are illustrative addresses, not pages to submit. Replace them with your own published URLs. Settle the addresses before producing tags; our guide to choosing a URL slug can help with that planning.

Language and country are different choices

en-IN means English for India; hi means Hindi without a country restriction. A country alone is invalid. For UK targeting, use GB, not UK. See supported language and region codes.

Only create a regional edition when the content needs one. In this example, removing the India-specific material might leave a single general English edition sufficient for the editorial plan.

Understand the complete annotation set

Each version must reference itself and the other versions using full URLs. Links must work in both directions. The HTML annotations belong in the <head>, with the same set on all three pages. Google explains these requirements.

<link rel="alternate" hreflang="en" href="https://example.com/en/bread-guide/" />
<link rel="alternate" hreflang="hi" href="https://example.com/hi/bread-guide/" />
<link rel="alternate" hreflang="en-IN" href="https://example.com/en-in/bread-guide/" />

Think of this as one shared list for the recipe, rather than three separately typed lists. Save the mapping alongside the article brief so a later editor can see which editions belong together.

Generate the block with the on-site tool

Open the Hreflang Tag Generator. It starts with two rows and lets you add another. For this example:

  1. Enter the general English URL in the first Page URL field. Choose English under Language and leave Region (optional) at No region.
  2. Use the second row for the Hindi URL with Hindi and No region.
  3. Click Add row. Enter the India edition URL, select English and choose India.
  4. Click Generate Tags. Review HTML link tags, then use Copy when the addresses match your mapping.

The tool also offers an HTTP Link header view. It generates text from your entries; it does not install the annotations, visit the destination pages or confirm their translations.

Install through the system that manages your pages

For HTML, add the generated block through your existing multilingual plugin or template integration. Do not paste it into the visible article body. If a plugin already manages alternate-language annotations, update its page relationships instead of adding a second independent block.

Check canonical tags separately

Hreflang and canonical annotations have separate jobs. Google recommends a canonical in the same language when using hreflang. Do not automatically canonicalize the Hindi translation to English just because English was written first. Review Google canonical guidance when resolving duplicate URLs.

Choose an optional fallback deliberately

An optional x-default annotation identifies the fallback for unmatched language or region settings. It can point to a selector or a default edition, as explained in Google guidance on x-default. Here, choose general English if that is your intended fallback.

In the generator, click Add x-default row and enter the general English address. Generate again; the extra line should be:

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

Review every published edition

Use a small review sheet with one row per real URL and columns for content, destination and annotations. Start with these checks:

  • Open every address while logged out. Confirm it displays the intended recipe edition, rather than a login page, error or unrelated destination.
  • View page source and search for hreflang. Compare the three sets against the saved mapping, including the self-reference and return links.
  • Inspect the surrounding markup. Confirm the block is in the head and not printed below the recipe.
  • Read the main instructions and test the visible language-switch links on a phone.
  • Check the actual canonical value after publishing, especially if the plugin or template was recently changed.

Record the date and any mismatched URL before editing. That creates a useful repair list instead of relying on screenshots of the generator alone.

Keep the mapping current when URLs change

For a small group, maintain one implementation. Google supports HTML, HTTP headers and sitemap annotations as equivalent methods; combining them brings no Search benefit. If you use a sitemap approach, follow the alternate-language extension rules rather than assuming an ordinary URL list provides the annotations.

Our small-website sitemap guide explains the basic URL-list workflow. When an edition moves, update its entry in the translation mapping and repeat the checks on the affected pages. Correct annotations describe the relationship between existing editions; they do not replace useful translations or guarantee higher rankings.