-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SEO Audits] Document has a valid rel=canonical #3178
Comments
For the record: we agreed that we should also support canonical Link headers. Questions:
Why
|
Good questions :)
We should fail the audit and specify the failure reason being conflicting canonical links.
Failing when invalid SGTM. Again, we should be clear about the failure reason.
The advice came from an offline thread. Forwarding to you for context.
Yeah worth checking to be sure. It does seem like the docs use different domains, for example with/without the www subdomain, although having different TLDs may not be valid. |
Thanks for a quick response!
Thanks! It does sound a bit GoogleBot specific, doesn't it?
Right, I meant TLDs. Sorry for the confusion. I absolutely agree that we should show failure reason, especially that now we have couple of them. Should we just use the ATM we have these failure reasons:
How that list looks to you? I'd appreciate a bit of help with a copy for the last one :) |
To sum up our email/hangouts discussion, we decided to fail in these cases:
While writing tests I found two more edge cases:
|
@rviscomi I got asked why we fail canonical audit when someone has the same canonical in both request header and head of the page (happens for e.g. https://www.12starsmedia.com/). At first it felt like a bug, but this quote tells me that we did it on purpose (?)
I does fill counterintuitive and linked article doesn't really say, now that I reread it, what I claimed it was saying 🤔Do you remember the discussion about it? |
Maybe this? I'm not certain if they mean identical in this case, but it could make sense. Admittedly our duplicate is due to our using the SEOmatic plugin for Craft. If it seems likely Google would penalize us for this, we're more than happy to address it with the plugin authors.
|
Yeah, I'm not 100% sure about that either. Maybe Rick will remember, and if not, we will double check with John. |
Also, in the second point of the conclusions.
Thank you for all your help with this @kdzwinel. :) |
I don't remember exactly, but rereading the doc, it does seem like we're doing the right thing. Please do reach out to John and confirm that having the same canonical URL in both a header and meta tag is invalid. |
Hello everyone, I'm the author of the SEOmatic plugin for Craft CMS 2 that @TimothyLoyer has referenced. What I'm doing is adding the exact same canonical URL both as a tag, and also as a header. I also do this for the From the linked article:
To me this implies that there is only an issue if there are multiple conflicting canonical URLs? If they are the same URL, whether appearing multiple times as a tag or one as a tag, another as a header... I'm not seeing anything stating this is an issue? I'm happy to alter the plugin to do whatever best practices are, but on this topic, I wasn't able to find anything definitive one way or another? |
IMO the ambiguity comes from this sentence:
Out of context, it's not clear if "multiple" refers to any two canonical URLs. The previous sentence about different URLs could just be an example of a common cause of this type of error, or it could be the only case. I reached out to my resident SEO expert and I'll update this thread with their guidance. |
Ultimately, what really matters is how Google, and to a lesser extent, other search engines handle this situation. I would think that as long as the canonical URLs are not in conflict, that it should be okay with it, but I have no knowledge of Google's internal workings on this front. |
Given that it is highlighted as a problem by the Lighthouse tool (which is a Google product), I'd guess that it is recommended to only serve one canonical URL (be it via header or link tag). However, multiple robots tags are not highlighted as an issue by the Lighthouse tool. |
@auralon That definitely could be; but Google is a big place, and the team that works on Lighthouse may or may not overlap the team that works on GoogleBot. |
@khalwat true, true! |
I got confirmation from John Mueller himself (thanks John!) that this is a bug. We should only fail when there are multiple different canonical URLs. Reopening the issue. @TimothyLoyer @khalwat @auralon would either of you like to implement the fix? @kdzwinel is working on a higher priority issue (#4359) so this may not be fixed as quickly. |
Great, thanks for tracking this down! |
Thank you, all, for looking into this! |
Audit group: Content best practices
Description: Document has a valid
rel=canonical
Failure description: Document does not have a valid
rel=canonical
({value})
Help text: Canonical links suggest which URL to show in search results. Read more in Use canonical URLs.
Success conditions:
head > link[rel=canonical]
doesn’t match any elements; otherwisehref
value of canonical link is not set to the root; otherwisehref
and current page are differentlocation.pathname
is not the root.href
value of canonical link is absoluteValid examples:
example.de/
,<link rel="canonical" href="example.com/de/">
example.com/de/
,<link rel="canonical" href="example.de/">
Invalid examples:
example.com/blog/
,<link rel="canonical" href="example.com/">
example.de/
,<link rel="canonical" href="example.com/">
example.com/de/
,<link rel="canonical" href="/">
The text was updated successfully, but these errors were encountered: