The other day, Google employee John Mueller answered a question regarding the presence of two rel = canonical attributes pointing to different URLs on the same page.
The question looked like this:
What happens if you have two canonical tags on a page with two different URLs? Does Google ignore them completely? My initial tests show yes (ignore), but can you confirm @JohnMu?
— Ryan Mews (@RyanMews) November 5, 2020
The author of the question wrote that according to his tests, in this case, Google ignores these attributes.
Müller confirmed his findings. According to him, in this case, rel = canonical is not defined, and Google uses other signals.
He also added that rel = canonical is not a directive, but just one of the signals used in the canonicalization process.
AFAIK it’s just undefined (so if you want it to do something, write it right). Also, rel-canonical isn’t a directive, it’s just one of the signals that flows into the canonicalization process.
— John (@JohnMu) November 5, 2020
As a reminder, canonicalization and duplicate content detection were discussed in detail in the latest episode of the Search Off the Record podcast, which is being prepared by Google employees.