Hi,
It seems to be a problem in the Joomla language filter plugin.
The "hreflang" tag added for the en-US language on this page has the same href as the canonical tag added by HikaShop.
Because of this, it overwrites HikaShop's canonical tag.
However, I don't think it should add a hreflang tag for the current language. The plugin should only add the tag for other languages than the current one. For example, on
moz.com/learn/seo/hreflang-tag
it provides an example of a spanish language page, with alternate tags for portuguese and french but not for spanish.
I think either of two things should be done:
- In the language filter plugin, the line:
$language->link = Route::_($currentInternalUrl);
should be changed to :
in order to not add an alternate tag for the current language
- In the Document class of Joomla, the meta tag links are stored based on their URL only. So if two different extensions want to add a link meta tag with the same URL but for different purposes, they can't, only the last one will be taken into account, like here. I don't know if it would be interesting to change the Document class to store the links based on both the URL and the relation parameter in order to give more flexibility.
I'll post an issue on the Joomla github.