Making WordPress.org

Opened 6 years ago

Closed 6 years ago

#4150 closed defect (bug) (fixed)

canonical on homepage

Reported by: joostdevalk's profile joostdevalk Owned by:
Milestone: Priority: highest omg bbq
Component: General Keywords:
Cc:

Description (last modified by joostdevalk)

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

https://wordpress.org/

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)

gsc-wordpress-org.png (251.9 KB) - added by joostdevalk 6 years ago.

Download all attachments as: .zip

Change History (7)

#1 @joostdevalk
6 years ago

  • Description modified (diff)

#2 follow-up: @Otto42
6 years ago

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.

#3 @joostdevalk
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?

#4 @Otto42
6 years ago

Probably. I would want to test that to be sure. :)

#5 @joostdevalk
6 years ago

Well, please do :D

#6 in reply to: ↑ 2 @SergeyBiryukov
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 :)

Note: See TracTickets for help on using tickets.