seo icon indicating copy to clipboard operation
seo copied to clipboard

Canonical doesn't support {% paginate %} pages

Open MarkOlijslagers opened this issue 4 years ago • 3 comments

Description

When using {% paginate %} the url's are appended with page numbers like /p1. The canonical tag of the paginated pages are all set without page number.

Additional info

  • Craft version: 3.5.17.1
  • SEO version: 3.6.7
  • PHP version: 7.4.9

MarkOlijslagers avatar Dec 21 '20 19:12 MarkOlijslagers

@MarkOlijslagers did you ever find a solution to this? Im having the same issue with canonical URLs & pagination

thomEpps avatar Jan 10 '23 13:01 thomEpps

@MarkOlijslagers did you ever find a solution to this? Im having the same issue with canonical URLs & pagination

@thomEpps , no we took this for granted. Hopefully this will be fixed in an upcoming release

MarkOlijslagers avatar Jan 11 '23 10:01 MarkOlijslagers

It might be sufficient to change this line to

return UrlHelper::siteUrl(Craft::$app->request->getFullPath());

See: https://github.com/ethercreative/seo/blob/dc9fa7f47bb5e542afe2f7c7f8d09f047c55ce4c/src/models/data/SeoData.php#L381C41-L381C41

I am not aware of counter-issues, I'll open a PR to see if we can close this quickly.

therealpecus avatar Sep 30 '23 14:09 therealpecus