On-page and technical checks

Hreflang tag: when a small site needs it, and common mistakes

What the hreflang tag does, when a small business site actually needs it, how to write it, and the common mistakes to check for.

The hreflang tag tells search engines which language or regional version of a page to show to which searchers. Most small business sites do not need it, because they have one language and one version of each page. If your site has the same page in Hindi and English, or for two regions, the tag must be written correctly, and it is worth checking for the common mistakes.

What hreflang tells a search engine

An hreflang annotation is a line of code placed in the head of a page. It names a language, optionally with a region, and the address of the version meant for that audience. It does not translate anything. You still write and publish each version yourself. The annotation only helps a search engine choose the right version for a searcher.

A woman and a colleague discuss a laptop at a dental clinic front desk.
Each language version of a clinic page needs to be prepared and published.

A pair of versions for a dental clinic looks like this:

<link rel="alternate" hreflang="en-IN" href="https://www.example.org/services/">
<link rel="alternate" hreflang="hi-IN" href="https://www.example.org/hi/services/">

Each version carries the same full set of lines, including a line that points to itself.

When you need it: the same page in two languages or for two regions

You need hreflang when one page has real counterparts in another language or for another region. Common cases in India look like this:

  • A clinic has an English services page and a Hindi services page with the same content.
  • A coaching class has English and Gujarati versions of its course pages.
  • A business has separate pages for customers in India and customers in another country, each written for that market.

Hreflang is needed only when a site has more than one language or regional version of the same page. Count the versions first, and only then write the lines.

Does a page need hreflang?A decision path showing when a page needs hreflang lines and when it does not.Does a page need hreflang?Count the language orregional versions of thepageIs there a true counterpartin another language orregion?Skip hreflang forthat pageNoYesPut the lines in the head ofeach versionEach version lists itself andthe othersAUTOMIX AI
Count the versions first, then write the lines.

When you do not

You do not need hreflang in these cases:

  • Your site has one language and one version of each page.
  • A page in English mentions Hindi, for example a post about learning Hindi. That is one page, not a second version.
  • A Hindi blog post covers a topic that your English blog never covered. It is a different page, not a translation.

Adding hreflang to pages that have no true counterpart only adds lines that point to nothing useful.

How the annotation is written

Follow these rules when you write the lines.

  1. Use a language code, and add a region code only when the region matters. Examples are en, en-IN and hi-IN.
  2. Use the full address of each version, starting with https.
  3. Every version lists itself and every other version. The English page lists the Hindi page, and the Hindi page lists the English page.
  4. Put all the lines in the head of each page, and keep the same set on every version of the page.

A simple check is to count the lines. If two versions of a page are listed, each page should carry two lines. If three versions exist, each page should carry three.

These are the mistakes that show up most often.

A man reviews a laptop at a wooden table in a tailoring workshop.
Review page annotations for duplicates, missing return links and incorrect codes.
  • Duplicate lines. Two lines with the same language code on one page confuse the search engine about which version is meant. Khoji's extended on-page checks include duplicate hreflang.
  • Missing return links. The English page points to the Hindi page, but the Hindi page does not point back. Every version must list the others, or the pair does not match.
  • Wrong codes. Writing "india" or "hindi" instead of a language code, such as hi-IN, makes the line unusable.
  • Broken addresses. A line that points to a page that does not exist, or to a redirect, sends the searcher nowhere useful.

Khoji reports hreflang problems as notes. A note is a small improvement, so fix it, but do not treat it as a reason to rebuild the site.

Checking it

Khoji runs seventeen on-page checks on a page you give it. Seven of these are extended checks, and one of them is duplicate hreflang. Use the audit on each version of a page, then follow these steps:

  1. Open the English page, view its source and read the lines in the head.
  2. Open each address in the list and confirm it is the right language.
  3. Open the other version and confirm it lists the first version back.
  4. Run an audit on each version and fix any error before any warning or note.

Each language version also needs its own clear main heading in its own language. The H1 tag guide explains how to write one. Once a single page is correct, you can run a full crawl of the site with Khoji to find broken links and duplicate titles across the rest of the pages. Plans and prices are on the Automix AI pricing page.

Checking hreflang across two versionsFour steps to check hreflang lines on a pair of page versions.Checking hreflang across two versions1Read the lines in the page headView the source of the page2Open each address in the listConfirm each one is in the right language3Check the other version lists the firstEvery version lists the others back4Run an audit and fix errors firstThen fix warnings and notesAUTOMIX AI
Fix errors before warnings and notes.

Frequently asked questions

What is an hreflang tag?

An hreflang tag is a line of code in the head of a page that names a language, or a language and region, and the address of the version meant for that audience. It tells search engines which version to show to which searchers. It does not translate anything, so you still write and publish each version yourself.

Do I need hreflang for a Hindi and English site?

Only if the same page exists in both languages at separate addresses. If your Hindi and English pages cover the same services, each version needs the hreflang lines that point to the other. If Hindi pages cover different topics from your English pages, they are not versions of the same page, and hreflang does not apply to them.

Does hreflang improve rankings?

Hreflang does not translate content and does not guarantee a ranking. Its job is to help a search engine pick the right language or regional version for a searcher. No tool or agency can guarantee a ranking, because search engines decide rankings.

How do I check hreflang tags?

Open the page source and read the lines in the head. Check that each address opens, that each one is in the right language, and that every version lists itself and the others. Then run a Khoji audit on each page. The audit includes a duplicate hreflang check and lists any issues by error, warning or note.

To run a check on your own pages, run a Khoji SEO analysis on your own site.

More in On-page and technical checks

All On-page and technical checks guides · Khoji blog

Run a Khoji SEO analysis on your own site