Ad

Hreflang Issue From Webmaster Tools

So I use href lang ONLY on my INDEX page, like this:

<link rel="alternate" target="_blank" rel="nofollow noreferrer" href="https://example.com" hreflang="x-default" />

But I keep getting these errors in google webmaster tools

Google has detected that some pages on your site have implemented the rel-alternate-hreflang tag incorrectly. In particular, there seems to be a problem with incorrect language and region codes, or incorrect bi-directional linking (if page A links with hreflang to page B, there must be a link back from B to A as well). Google uses the hreflang attributes to serve the correct language or regional URL to the right users in search results. Until you correct the errors on the hreflang links, your website will not benefit from additional language or region targeting.

I don't understand why? I searched alot and can't seem to find an answer.

Ad

Answer

If you don't have any pages with locales listed, then just use x instead of x-default (or indeed the language-code, e.g. en/de etc.)

Usually you would use hreflang=x-default in a a set like this (note the several locales indicated in the alternate pages)

<link rel="alternate" hreflang="x-default" target="_blank" rel="nofollow noreferrer" href="http://www.example.com/" />
<link rel="alternate" hreflang="en-gb" target="_blank" rel="nofollow noreferrer" href="http://en-gb.example.com/page.html" />
<link rel="alternate" hreflang="en-us" target="_blank" rel="nofollow noreferrer" href="http://en-us.example.com/page.html" />
<link rel="alternate" hreflang="en" target="_blank" rel="nofollow noreferrer" href="http://en.example.com/page.html" />
<link rel="alternate" hreflang="de" target="_blank" rel="nofollow noreferrer" href="http://de.example.com/seite.html"/>

Footnote: I found a handy hreflang generator tool here

Ad
source: stackoverflow.com
Ad