tobimori / kirby-seo

🔎 All-in-one toolkit that makes implementing SEO & Meta best practices in your Kirby 4+ site a breeze
https://plugins.andkindness.com/seo
MIT License
85 stars 13 forks source link

Incorrect canonical tag on pagination #109

Closed PierreClementCazon closed 2 months ago

PierreClementCazon commented 2 months ago

Hello and thank you for this plugin.

I've identified an SEO problem with the pagination canonical tag on my blog.

All the pages are canonical to the blog page without any parameters.

However, for older articles to be accessible, the canonical tag must be different on each page of the pagination and the meta title must also be different on each page of the pagination (by inserting the page number for example).

Best regards.

tobimori commented 2 months ago

Please use page models to override the url() method of the page to return the current param if specified.

Unfortunately, this is a mine field that won't be natively supported by the plugin since Kirby parameters have the same issue as query strings, since they can be multiple of them in any order.

So given a page like... example.com/search/query:test/page:2

...this would yield the same results: example.com/search/page:2/query:test

There's also no way to check if a param is actually used in the code. So if someone goes to your page like example.com/blabla:test, Kirby will output the same page and the SEO plugin, if it would work with params, would create a new canonical for this which creates duplicate content.