Hello,
Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.
As I can check, you have set your paginated pages to noindex. We only add the canonical to pages that are set to index, if you have enabled the option to noindex the paginated pages the canonical won’t show up on those pages.
And the canonical is used to inform the search engine crawlers about the original content and stop them from indexing the duplicate content. Since you have already stopped paginated pages from getting indexed, you don’t need a canonical tag.
If you still want to add the canonical URL to those pages then you will have to set them as index first, from WP Dashboard > Rank Math > Titles & Meta > Misc Pages, and disable the Noindex Paginated Pages option. Then add the code given below in your theme’s functions.php file to set the canonical URL as the URL of the main page:
add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
if ( is_paged() ) {
$link = $_SERVER['REQUEST_URI'];
$arr = explode('/p/', $link,);
$canonical = home_url($arr[0]. '/');
}
return $canonical;
});
Hope this helps. Let us know if you need any further assistance.
Hi, i insert this code to functiond php of my child theme, opened pagination for index, and i have the same situation (check screenshot – https://ibb.co/Xzvc1yF)
Again i had this:
<link rel=”canonical” href=”https://spain-residence.com/articles/page/4// />
<link rel=”prev” href=”https://spain-residence.com/articles/page/3/ />
<link rel=”next” href=”https://spain-residence.com/articles/page/5/ />
but i need this:
<link rel=”canonical” href=”https://spain-residence.com/articles/ /> (changing here, canonical to main, first page of archive)
<link rel=”prev” href=”https://spain-residence.com/articles/page/3/ />
<link rel=”next” href=”https://spain-residence.com/articles/page/5/ />
Hello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress login in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.

It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping 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.