← Back to all FAQs
FAQ

What is hreflang?

Hreflang is an HTML attribute used to tell search engines which language and geographic region a specific page is intended for, which is essential for websites that have multiple versions of the same content targeting different countries or languages. When a website has, for example, an English version for the United States, a Spanish version for Mexico, and a French version for Canada, hreflang tags help search engines like Google understand these relationships and serve the correct version of a page to users based on their language settings and location, rather than accidentally showing an English speaker the French version or treating the different language pages as duplicate content that competes against each other in search results. Hreflang tags are implemented using a specific format that combines a language code, like 'en' for English, with an optional region code, like 'us' for the United States, written together as 'en-us', and these tags need to be added either within the HTML head section of each page, within an XML sitemap, or through HTTP headers. Properly implementing hreflang is genuinely tricky and error-prone, since every page needs to reference not just itself but all its alternate language versions, including a return tag confirming the relationship, which is why hreflang errors are extremely common.

← how to increase readability score how to fix hreflang tags with errors →