Page MenuHomePhabricator

Set canonical url tag for all pages
Open, Needs TriagePublic

Description

We've had some reports of pages appearing in google twice for some Miraheze wikis.

When I looked closer I saw that there was no canonical tag set by MediaWiki in the <head> and the urls were different.

Example:

https://moviepedia.miraheze.org/w/index.php?title=Category%3AMark_Consuelos&mobileaction=toggle_view_desktop
https://moviepedia.miraheze.org/w/index.php?title=Category%3AMark_Consuelos&mobileaction=toggle_view_desktop and https://moviepedia.miraheze.org/wiki/Category:Mark_Consuelos

We should set a canonical tag on all variations of a page that are the exact same.
So https://moviepedia.miraheze.org/w/index.php?title=Category%3AMark_Consuelos&mobileaction=toggle_view_desktop would have https://moviepedia.miraheze.org/wiki/Category:Mark_Consuelos as the canonical url.

We should use the article entry point to define the canonical and strip anything in & parameters that don't change how the page is displayed.

Event Timeline

Restricted Application added subscribers: Reception123, Aklapper. · View Herald Transcript

I would add SEO but it won't come in the project tags menu

Added another hashtag to it to fix it

@RhinosF1: Which codebase is this about? Same issue as T93550: Fix canonical URL issues (tracking) maybe?

This is would be mediawiki core. I would say that would be the right parent task for this.

@RhinosF1: Which codebase is this about? Same issue as T93550: Fix canonical URL issues (tracking) maybe?

This is would be mediawiki core. I would say that would be the right parent task for this.

I think

we're serving canonical URL tags with URL parameters. For example, https://en.wikipedia.org/wiki/Category:Living_people?from=Fe. I don't know what the parameter from specifies, but canonical URLs generally shouldn't include URL parameters, mostly because URL parameters shouldn't be used to identify a unique canonical page. We could address this issue by telling Google, for each of our sites (e.g. all 286 language versions of Wikipedia), to ignore certain URL parameters (e.g. the page for en.wiki). That's a hack though we should just fix the app to strip URL parameters from canonicals

Is this issue here? maybe a dupe? maybe a valid subtask?