Opened 6 years ago
Closed 6 years ago
#4150 closed defect (bug) (fixed)
canonical on homepage
Reported by: | joostdevalk | Owned by: | |
---|---|---|---|
Milestone: | Priority: | highest omg bbq | |
Component: | General | Keywords: | |
Cc: |
Description (last modified by )
The canonical on the wordpress.org homepage is broken which is causing a TON of issues in Google Search.
https://wordpress.org/?v=true
does not output a canonical, whereas
does. Both should output the exact same canonical. This is causing issues with Google self-selecting the canonical for the .org homepage and doing so horribly wrong in quite a few occasions, for example, see attached screenshot. Top left shows tested URL, bottom right shows Google's "Google-selected canonical".
Attachments (1)
Change History (7)
#3
@
6 years ago
You're right. But the front page is a specific template right? Because then getting the site URL and trailingslash-ing it would fix it?
#6
in reply to:
↑ 2
@
6 years ago
- Resolution set to fixed
- Status changed from new to closed
Replying to Otto42:
WordPress itself doesn't do canonical for front-page's, so, there's no code in there to do that.
It does when a front page is set as such in Reading Settings.
Interestingly enough, Rosetta sites already did have a proper canonical URL on home page, as seen on https://ru.wordpress.org/. The difference was that they actually have an empty "Home" page assigned as a static front page in Reading Settings. The meta tag is then printed by rel_canonical()
function from core.
This page was missing on the main WordPress.org site. I've created one for the sake of consistency, and now rel_canonical()
does its job as expected, no code changes needed :)
The homepage, when retrieved with just https://wordpress.org, is actually a static page. The canonical there is hardcoded.
When URL parameters are passed to it, the static version is bypassed and the underlying WordPress instance is run, so what you're getting there is actually the homepage as generated by WordPress, using the wporg-main theme. It's largely the same, as you can see, except it's translatable, for rosetta sites which use it.
WordPress itself doesn't do canonical for front-page's, so, there's no code in there to do that. We could add that to the theme, but we would also need to make it aware of when the theme is running on other domains. We probably don't want nl.wordpress.org to have a canonical pointing back at wordpress.org, I expect.