hreflang
An annotation that tells search engines which language or regional version of a page to show to which audience.
What it is
hreflang links equivalent pages across languages and regions, such as an English page and its Arabic version, or ar-SA and ar-AE. It can live in the HTML head, in HTTP headers or in the XML sitemap. Search engines use it to swap in the right URL in results; it is not a ranking factor by itself.
Why it matters
Without it, the wrong language version can show up in the wrong market, and similar pages can be treated as duplicates. For a bilingual Arabic and English site it is one of the most common sources of silent errors.
Common mistakes
- No return links: every version must point back to the others and to itself
- Wrong or invented codes: use ISO 639-1 language and ISO 3166-1 region codes
- Pointing to redirected, noindex or non-canonical URLs
- A canonical that points to a different language version
How I handle it
I crawl both versions, compare the return links and codes against what Search Console reports, and write the fix as a rule your developers can apply once across the template or the sitemap.
How to check it
- Crawl the site and export the hreflang annotations for a sample of pages in each language.
- For every page, confirm each alternate points back and that a version lists itself.
- Check that every hreflang URL returns 200, is indexable and is its own canonical.
- Compare with Search Console to see which version Google actually shows in each market.
Illustrative example
Example scenario: an English page lists its Arabic version, but the Arabic page has no tag pointing back. Search engines treat the pair as unreliable and may show the English page to Arabic searchers. Adding the return link, and listing each page in its own set, fixes it.
Frequently asked questions
Where should I put hreflang: head, headers or sitemap?
Any one works. On large sites the XML sitemap is often easiest to maintain. Pick one method and keep it consistent.
Does hreflang improve rankings?
Not directly. It helps the right version appear for the right audience and reduces duplicate-content confusion.