vaersaagod/seomate

Fix canonical url on paginated content

Closed this issue · 3 comments

rbrv commented

Craft supports pagination of content with a specific page trigger.

At the moment, no matter what page a visitor is on, the SeoMate-generated canonical url points to the first page. SEO best practices dictate it should point to the paginated URL.

Reference article: https://www.searchenginejournal.com/technical-seo/pagination/

How it is now

  • URL: /news/p5
  • canonical tag: /news

How it should be

  • URL: /news/p5
  • canonical tag: /news/p5

I'm able to reproduce.

This only happens if there's an element matched for the current route – for example if you're using {% paginate %} in a template that's set as the entry template for a section (in which case there's going to be an entry matched for the request, and SEOMate will output that entry's URL for the canonical, and disregard the pagination trigger in the current request URL).

I agree that this is a bug though – will get it fixed.

This was fixed in 1.1.5.

I'm still facing this issue. Will try to set the canonical URL manually instead. But it would be great of this can be fixed within the plugin itself.

SEOMate: 1.1.7
Craft: 3.4.30