Hello,
Thank you for your query and we are so sorry about the trouble this must have caused.
Can you please confirm if both the pagination link format is working? If so, you can create a redirection from the pagination link to the preferred format.
Don’t hesitate to get in touch with us if you have any other questions.
Hello,
yes both links are working. Do you mean a 301 redirect? As I think that is not ideal, i would rather prefer showing google the correct url directly in the document instead of redirecting every pagination page. As we do not want to waste any crawl budget or things like that with unnecessary 301 redirects.
Best regards,
Jan Herkelmann
Hello,
In this case, you can use this filter code to make sure the correct adjacent links are added: https://rankmath.com/kb/filters-hooks-api-developer/#change-adjacent-link-output
Also, you may mark the unwanted format as noindex
by using this filter code: https://rankmath.com/kb/filters-hooks-api-developer/#change-robots-meta
You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.
I have taken a look at the filter and tried several but the output was never correct how can we achieve the desired output using the filter can you put us on the right track? Thanks in advance.
Hello,
In this case, please share the affected pagination URLs so we can check the tags and their canonical URLs.
You can add them in the sensitive data section

It is completely secure, and only our support staff has access to that section.
Looking forward to helping you.
Thank you.
I have deactivated and delted the snippet as I do not want it to cause any harm. Isn‘t it possible for you to provide us the correct code snippet I would really appreciate this.
Hello,
Please try this code and see if this would work:
add_filter( "rank_math/frontend/next_rel_link", function( $link ) {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
if(is_paged()){
$link = '<link rel="next" href="/category?_pagination=' . $paged + 1 .'" />';
}
return $link;
});
add_filter( "rank_math/frontend/prev_rel_link", function( $link ) {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
if(is_paged()){
$link = '<link rel="prev" href="/category?_pagination=' . $paged - 1 .'" />';
}
return $link;
});
add_filter('rank_math/frontend/robots', function ($robots) {
$url = home_url($_SERVER['REQUEST_URI']);
if (strpos($url, '/category/page') !== false) {
$robots['index'] = "noindex";
$robots["follow"] = 'nofollow';
return $robots;
}
return $robots;
});
Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.
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.