What hreflang is for
When the same page exists in several languages, hreflang tells Google which version to show to whom. Without it, a Bangla page and an English page about the same thing look like duplicates competing with each other; with it, each one is shown to the right audience.
The rules that trip people up
- Every version must link to every other version, including itself. A page that is listed but does not link back is ignored.
- Use the right codes: language in ISO 639-1 (
bn,en), optionally a region in ISO 3166-1 (en-GB,hi-IN).en-UKis wrong; the country isGB. - Full URLs only, including
https://. - Add x-default for the page to show when nothing else matches — usually the English or language-picker page.
- Keep canonical tags consistent: each version should point its canonical at itself, not at another language.
How to use the generator
- List one version per line — the code, a space, then the full address.
- Pick a format. Link tags go in the head; HTTP headers suit PDFs and other non-HTML files; the sitemap block keeps the whole set in one place.
- Copy the block and put the same one on every version of the page.
Which format to use
- Link tags — simplest for a small site, but they add weight to every page.
- Sitemap — best for a big site: one file to maintain, and nothing in the page itself.
- HTTP headers — the only option for files that have no head, such as PDFs.
After you publish
Google re-crawls each version before it trusts the set, so give it a few weeks. The International Targeting report in Search Console lists hreflang errors, and "no return tags" is nearly always the problem — one version in the group is missing the block.
Frequently asked questions
Do I need hreflang on every page?
On every page that has more than one language version, yes — and the block has to list all the versions, including the page itself.
What is x-default?
The version shown when none of the listed languages match the visitor. It is usually your English page or a language-picker page.
Is it en-GB or en-UK?
en-GB. The language code is ISO 639-1 and the region is ISO 3166-1 alpha-2, where the United Kingdom is GB. Wrong codes are ignored entirely.