Subscribe! You can subscribe to this podcast on Apple Podcasts, Anchor, Google Podcasts, Spotify, Breaker, Pocket Casts, RadioPublic, Stitcher, Overcast, and a variety of other places. Be sure to rate the podcast wherever you choose to listen!
In a recent thread over on Reddit, a user complained that Google was ignoring the canonical links that they were setting on their site and it was causing some problems.
If you’re not familiar with the term, canonical URLs are a snippet of text that you can put in the code of your site to tell Google what page it’s on. This can be useful if you have very similar pages, perhaps with something like “sort=name” and the same page with “sort=color” in the address; they’re both for the same page, but the URL is technically different. You can use the canonical URL to tell Google that they’re same, which is good for your rankings.
However, this particular user was having trouble because Google was ignoring their canonical addresses and matching things up in a weird way. In this case, the site was using Angular JS to show their content and Google was having a hard time reading it.
Google’s John Mueller jumped into the thread and had a lot to say, including: “With canonicals, the first question on Google’s side is always: Are these URLs for the same content? And if they’re not meant to be the same, why might Google think that they are?”
“There are multiple reasons why JS might not be executed properly, sometimes it’s just because it’s flakey code, sometimes it doesn’t degrade gracefully, sometimes resources or server responses are blocked by robots.txt, or it can be that it just takes too long to be processed.”
“I think that’s what’s happening here. Google sees those pages as serving mostly the same content, which is a sign that Google can’t pick up the unique content on the pages properly.”