Hello,
We apologize for the issue you are facing with changing the canonical URL for your category pagination. To set the canonical URL of your category pagination pages to point to the category homepage, you can follow these steps:
-
Enable Advanced Mode in Rank Math if you haven’t already. You can do this by navigating to WordPress Dashboard → Rank Math SEO and enabling it from there.
-
Edit the Pagination Page: Go to the specific pagination page you want to edit.
-
Set the Canonical URL: In the Rank Math meta box, find the Advanced tab. Here, you will see a field for the Canonical URL. Enter the URL of your category homepage in this field.
-
Update the Page: After entering the canonical URL, make sure to update the page to save your changes.
By doing this, you will inform search engines that the canonical version of this pagination page is actually your category homepage.
If you have any further questions or need additional assistance, please feel free to reply to this ticket, and a human agent from our support team will assist you further. Thank you for raising this concern!
Sources:
Alternate Page with Proper Canonical Tag Status in Google Search Console » Rank Math
How to Fix ‘Duplicate Without User-Selected Canonical’ Status in Google Search Console » Rank Math
Hello,
To set the canonical to the first page, you can use this filter on your site:
add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
if ( is_paged() ) {
$link = $_SERVER['REQUEST_URI'];
$arr = explode('/page/', $link,);
$canonical = home_url($arr[0]. '/');
}
return $canonical;
});
And here’s a guide to adding the code to the website:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.