Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
Rank Math adds a self-referencing canonical URL by default, meaning if your paginated page is /page/2/, the canonical will be the same.
Could you please confirm if this is not the case on your site? Also, please share the affected URL so we can check as well.
Looking forward to helping you.
Thank you.
Yes, that’s correct, the canonical remains unchanged when paging.
This is the page: https://inforges.es/blog-inforges/
Hello,
To add self-referencing canonical URLs, please try adding the following filter:
add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
$current_url="https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if(false === strpos($current_url, '/blog-inforges/') || is_single()) return $canonical;
$canonical = strtok($current_url, '?');
return $canonical;
});
Here is how you can add filters/hooks to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how it goes. Looking forward to helping you.
Thank you.
Ok, we’ll do it this way. I’ll be back in touch with the result. Thanks.
Hello,
Sure, let us know how it goes.
Please do not hesitate to let us know if you need our assistance with anything else.
Thank you.
This solution has worked perfectly.
Thank you!
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.