Hello!
I just updated my website design and I also added a second language since localization feature is finally out.
The first problem I encountered was my website health rating (or whatever that is called) on ahrefs, semrush, etc went down dramatically. I have so many critical errors.
For example one error related to localization:
Ahrefs.com says my site has so many “Hreflang and HTML lang mismatch” errors on all of my pages. And the info they give about this error is:
"Pages with different language codes declared in HTML language attribute and in hreflang annotation for the URL.
Although Google might not be using the HTML lang attribute today, other search engines and browsers do."
First of all, I am not sure if localization fixes this issue out of the box or not. I am no expert. But it seems like it doesn’t. So I checked the options on my website. So normally I had language code “en” in my website settings. I thought maybe this code is telling search engines that my website content is in English while the website is offered in English and French now. So I get the error. So I removed it.
After a bit of research, I found out that I needed to add this code to my website. So I did. The code:
<link rel="alternate" href="https://www.mywebsite.com/" hreflang="x-default" />
<link rel="alternate" href="https://www.mywebsite.com/fr/" hreflang="fr-CA" />
But I still get the errors. So at this point I am cluless how to fix this issue.
The other localization related errors I am seeing on ahrefs.com are:
- Missing reciprocal hreflang (no return-tag)
Explanation for this error on their website:
“Confirmation (return) links are missing for the pages declared in hreflang annotations. If page A links to page B in hreflang annotations, page B must link to page A in return. If this is not the case for all pages that use hreflang annotations, those annotations may be ignored or misinterpreted correctly. This issue can also be triggered by misused “x-default” hreflang. Whenever the optional “x-default” hreflang value is used, all pages of the hreflang group must reference the same “default” page.”
This is the error detail I am seeing (if it helps):
- Hreflang to redirect or broken page
Explanation for this error on their website:
Pages that have a broken URL in their hreflang annotations.If hreflang URL does not point to a valid live page, hreflang annotations may be ignored or not interpreted correctly. Consequently, search engines may “overlook” alternate versions of your page and will not be able to point users to the most appropriate version of your page by language or region.
The error list goes on and on…
Could someone please guide me in the right direction to address this issue? I’m concerned that if it’s not resolved promptly, it could negatively impact my website.