The Hreflang tag attribute (also referred to as rel=”alternate” hreflang=”x”) tells the search engines about the language and region this website is localized into. So that the search engines can serve the right result to users searching in that language & location. If a website has multiple sister websites in different languages on different domains or if a website has multiple versions at the subdomain level or at the directory level, all the pages should still have Hreflang tags.
Hreflang Tag relationship
Let’s say there is one website in the UK English called examplewebsite.co.uk. The same website has two sister websites in German and French respectively. Those websites are examplewebsite.de and examplewebsite.fr
Now here is what the relationship should look like
- UK website should list German and French website as alternative websites using Hreflang tag
- But German and French websites should also list the other two websites as alternative websites using the Hreflang tag. This is called returning tag.
- If a website points to an alternative website but if the alternative website does not point back to the main website, Hreflang set is considered incomplete
Hreflang Tags best practices
After analyzing multiple international websites, here are some of the best practices that I have listed out for you.
Non-200 Hreflang URLs
Any URL which is a part of the Hreflang tag should not return 3xx, 4xx, or 5xx status code.
NOINDEX confirmation links
Any URL/page which is a part of the Hreflang tag should not have a “NOINDEX” meta tag on the page. If a particular page requires a “NoIndex” metatag, it should not get a Hreflang tag. Similarly, a page can be excluded from indexing using
Self-reference Hreflang tags
This tag is often open to discussion but I have seen that pages with self-reference Hrelfang tag are more targeted compared to pages with non-self reference tags. For example, for the example website in the UK, the self-reference Hreflang tag should be
<link rel=”alternate” href=”examplewebsite.co.uk” hreflang=”en-gb” />
All the pages/URLs should refer to themselves in the canonical meta tag. Self-referencing canonical is often missed in the following scenario:
- When we create a new page to replace the old page and pass the canonical to the new page
- The same applies to the blog when we create a new blog instead of updating the old blog and pass the canonical to the new blog.
No Hreflang URLs should redirect to testing server
Many a time, websites across different regions are the replica of a master website. In that case, if a link copied on the master website is from the testing server, it gets replicated across all the domains. So, please make sure that all the Hreflang tag URLs are legit and from the live server.
The x-default Hreflang tag is for situations where you want to provide a generic fallback website for any language/location which has not been defined on any of the web properties through Hreflang alternate tags. Most of the time, the X-default tag will point to the US English website.
Not all pages need Hreflang tag
The same applies to the page which is generally excluded through Robots.txt at the server level. For example, cart page or checkout page or thank you page after the conversion.
Incorrect language and region code
Not all the languages and regions are currently supported by the search engines. This article from Google refers to the currently supported language and region codes.
No relative path
Please do not use the relative path URL in the Hreflang tag. The path should be an absolute URL.