Hello, we apologize for the issue you are facing. To change the canonical URL for your category pagination to a specific URL like `https://rankmath.com/wp-content/uploads/2021/03/canonical-url-example.jpg you can do this through the Rank Math SEO plugin.
- Edit the Category: Go to your WordPress dashboard, navigate to Posts > Categories, and edit the category for which you want to change the canonical URL.
- Advanced Tab: In the category edit screen, scroll down to the Rank Math SEO meta box and click on the Advanced tab.
- Canonical URL Field: Here, you will find a field labeled Canonical URL. Enter your desired URL (`https://rankmath.com/wp-content/uploads/2021/03/canonical-url-example.jpg) in this field.
- Update: Make sure to save or update the category after making this change.
This will set the canonical URL for that category pagination to your specified blog page URL.
If you need further assistance or if this does not resolve your issue, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Sources:
Advanced Tab in Rank Math SEO’s Meta Box
Hello,
Thank you for contacting Rank Math support and bringing your inquiry to us.
To set the canonical URL for your category pagination to your blog page URL, you can use the following code snippet on your site:
add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
if ( is_category() && is_paged() ) {
$canonical = "https://ladyoferta.com/blog-de-ofertas/";
}
return $canonical;
});
This code checks if it’s a category archive page and a paginated page, then sets the canonical URL to your blog page URL.
Here’s a guide on how you can add a filter to your website:
https://rankmath.com/kb/filters-hooks-api-developer/
Let us know how this goes. Please let us know if you have further questions or concerns.
Thank you.
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.