Hreflang tags tell search engines which language or country each version of a page is for, so a Hindi speaker sees the Hindi page and a UK visitor sees the UK page.
<link rel="alternate" hreflang="en-in" href="https://pepploweb.com/en-in/">
<link rel="alternate" hreflang="hi-in" href="https://pepploweb.com/hi-in/">
<link rel="alternate" hreflang="x-default" href="https://pepploweb.com/">Rules
- Every version lists all versions, including itself.
- Links must be two-way: if A points to B, B points to A.
- Use correct codes: language (ISO 639-1), optionally country (ISO 3166-1).
- Add
x-defaultfor visitors who match none.
Generate tags with the hreflang tag generator and check a page with the hreflang checker. Also set the lang attribute on each page (language attribute checker).
Where to put hreflang
- In the HTML
<head>of each page (most common). - In HTTP headers for non-HTML files such as PDFs.
- In the XML sitemap, which is easier for large sites.
Use one method consistently.
Common mistakes
- Missing return links: page A lists page B, but B does not list A.
- Wrong codes, such as
en-ukinstead ofen-gb. - Pointing hreflang to redirected or
noindexpages. - Translating only the menu while the main content stays in one language.
Content, not just tags
Hreflang helps search engines choose between versions; it does not make a page relevant in another language. Translate properly, adapt prices and contact details, and write for local readers.
0 comments