Closed (works as designed)
Project:
Hreflang
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Sep 2015 at 21:08 UTC
Updated:
9 Oct 2015 at 22:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mfbI'm curious how important this is? Does having a canonical meta tag really break anything re: search indexing?
By the way, one way to implement this is to have a blank canonical meta tag configured in the metatag settings (this seems like an ok workaround, assuming that all sites that care about metatags will install the metatag module :)
Comment #3
kepford commentedThis patch adds checks for hreflang in meta tags and removes the canonical meta tag if a hreflang exists.
Comment #4
kepford commentedThe previous patch did not check for multiple hreflang tags. This patch checks to make sure there is more than one hreflang. Also moves logic into one function.
Comment #5
kepford commentedComment #6
damienmckennaSome minor changes, mainly dropping one of the variables.
Comment #7
kepford commentedPatch applies and works as intended.
Comment #8
mfbDid some reading about this. According to http://www.rebelytics.com/hreflang-canonical/ "If you are using a canonical tag solution on your website, make sure that URLs that have a canonical tag pointing to another URL do not receive hreflang annotations. hreflang annotations are okay for URLs that point to themselves via canonical tag and for URLs that do not have canonical tags."
Also, needs tests.
Comment #9
kepford commentedRight. So the idea is that if you only have one hreflang tag you can still have a canonical tag which is what the patch does. I'll work on adding tests.
Comment #10
mfbWhat about the suggestion that it's ok to have hreflang tags on URLs that have a canonical tag pointing at itself? It seems like what we actually need to do is remove the hreflang tags if the page has a canonical tag pointing elsewhere?
Comment #11
kepford commentedOk, now I get what you are saying @mfb. This seems to be a non-issue for hreflang module to me now. Agree @DamienMcKenna? I can't reproduce a condition where the canonical tag points to another language.
Comment #12
mfbFrom what I've seen in real-world testing, if I go to a node/[nid] page, the canonical and hreflang tags all point elsewhere (to the correct URLs using URL aliases), and I don't see why Google would be confused.