Elxis CMS Forum

Support => Technical support => Topic started by: seadhna on February 20, 2017, 12:53:50

Title: Errors in hreflang tags - no return tags
Post by: seadhna on February 20, 2017, 12:53:50
Hi there,
Google Webmaster Tools is returning errors on some alternate language pages, stating that these pages should contain links back to the original language. I see in the code of the alternate languages, there is no hreflang tag back to the English-language (primary language) version of the website - only to other language versions. e.g. on the French version of the page:

<link rel="alternate" hreflang="es" href="http://www.example.org/es/xxx.html" />
<link rel="alternate" hreflang="fr" href="http://www.example.org/fr/xxx.html" />

Is it possible to include a link to the primary language version here?
Title: Re: Errors in hreflang tags - no return tags
Post by: datahell on February 21, 2017, 13:07:33
Open this file:
includes/libraries/elxis/document.class.php
and comment line 396 (or somewhere near that):

//if ($lng == $elxis->getConfig('LANG')) { continue; }

Tell me if the problem was solved.
Title: Re: Errors in hreflang tags - no return tags
Post by: seadhna on February 21, 2017, 16:16:33
Great, thanks! This now has given the link to the English-language (primary language) version of each page in the source. I guess it will take 24-48 hours for Google webmaster tools to update.
Title: Re: Errors in hreflang tags - no return tags
Post by: datahell on February 21, 2017, 19:54:23
When ready please confirm me that the problem is solved.
Title: Re: Errors in hreflang tags - no return tags
Post by: webgift on March 02, 2017, 13:04:53
Dear @seadhna, please confirm if the reported issue is solved.
Title: Re: Errors in hreflang tags - no return tags
Post by: seadhna on March 13, 2017, 17:22:52
Sorry for delay. I had sent PM to datahell. yes, this problem was solved. Many thanks.