href lang
What is hreflang used for?
Seo main factors
Invalid hreflang
Users navigate on the Internet with a default language and region: websites show to every user their pages in a different way, according to these two parameters.
How do the search engines figure out what version (based on language or region) to show to the user?
They do thanks to the hreflang links, which give to the search engines the URLs of all the versions of a specific web page.
How the SeoChecker hreflang audit fails
When the hreflang links have something wrong, SeoChecker displays an error:
hreflang links are searched by SeoChecker in the head and in response headers of the page to scan.
Next step for SeoChecker is to examine if the hreflang links have valid language codes: if they haven't, SeoChecker will notify it.
N.B. Region codes and sitemaps will not be examined by SeoChecker.
How can I delineate the different versions of a page with an hreflang link for each one?
Let's take for instance a page that has some different versions:
You can choose between three methods to make them equal for search engines:
- Adding link headers to your HTTP response:
Link: <https://example.com>; rel="alternate"; hreflang="en", <https://it.example.com>; rel="alternate"; hreflang="it", <https://fr.example.com>; rel="alternate"; hreflang="fr" <https://de.example.com>; rel="alternate"; hreflang="de", <https://es.example.com>; rel="alternate"; hreflang="es"
- Updating the sitemap giving details of language version:
<url>
<loc>https://example.com</loc>
<xhtml:link rel="alternate" hreflang="it"
href="https://it.example.com"/>
<xhtml:link rel="alternate" hreflang="fr"
href="https://fr.example.com"/>
<xhtml:link rel="alternate" hreflang="de"
href="https://de.example.com"/>
<xhtml:link rel="alternate" hreflang="es"
href="https://es.example.com"/>
</url>
- To the head of every page you need, add hreflang links:
<link rel="alternate" hreflang="en"
href="https://example.com" />
<link rel="alternate" hreflang="it" href="https://it.example.com" />
<link rel="alternate" hreflang="fr" href="https://fr.example.com" />
<link rel="alternate" hreflang="de" href="https://de.example.com" />
<link rel="alternate" hreflang="es" href="https://es.example.com" />