WordPress pages have canonical entry to another website
-
We have a WordPress blog at https://www.rephunter.net/blog/. Many of the pages have a canonical link to another completely unrelated blog that I run personally, but has no connection to the blog in question.
For example, on the page https://www.rephunter.net/blog/keep-the-ball-rolling/, the following entry appears, with the actual site name replaced with asterisks:
<link rel=”canonical” href=”https://www.oofdah.com/blog/keep-the-ball-rolling/” />
So the result is that the canonical entry is not pointing to our website at https://www.rephunter.net, but instead is going elsewhere.Please note: because of changes we made described below, this wrong link is no longer present, and the canonical link is now as it should be.
The canonical link as far as I know is totally controlled by Yoast. However, we have never set up canonical entries at all.
As another measure, I grepped the entire code base but could not find anything in the code.
As a final step I looked into the Yoast tables in the database. In the indexable table, out of 600 rows, I found 17 rows that had in the permalink column references to the wrong URL. I checked the permalink for those pages, but they are not pointing to the wrong website but to the proper website.
As a test, I manually changed a permalink anyways and rechecked that table–it still was pointing to the wrong website.
Looking further into Yoast, I was able to run the “wp yoast index” command from the command line. The tables were re-indexed. However, the 17 entries are still pointing to the wrong website.
As a final step, I deactivated Yoast. After that those canonical entries pointing to the wrong site were no longer present on the pages in question.
I reactivated Yoast hoping that it might have fixed itself, but unfortunately the bad canonical links came back.
So the problem appears to be in Yoast, and somewhere it has got information about the wrong blog.
As an additional test, I manually updated the Yoast indexable table to change the permalink column on the 17 rows from the wrong website to the correct website. Then reactivated Yoast.
After those steps, the canonical entry is now correct. So the immediate issue is corrected. However, I would like to know how the indexable table was corrupted, as I suspect the problem could recur.
The page I need help with: [log in to see the link]
- The topic ‘WordPress pages have canonical entry to another website’ is closed to new replies.