Hello,
In that case, please use the filter code below to forcibly set the robots meta tag to noindex
:
add_filter( 'rank_math/frontend/robots', function( $robots ) {
$url = home_url($_SERVER['REQUEST_URI']);
if (strpos($url, '/blog/author/paridhi-wadhwani/page/3') || strpos($url, 'blog/author/chandresh-patel/page/2')) {
$robots["index"] = 'noindex';
$robots["follow"] = 'nofollow';
}
return $robots;
});
If you wish to do that to all paginated pages, you may refer to this code instead:
add_filter( 'rank_math/frontend/robots', function( $robots ) {
$url = home_url($_SERVER['REQUEST_URI']);
if (strpos($url, '/blog/author/paridhi-wadhwani/page/')) {
$robots["index"] = 'noindex';
$robots["follow"] = 'nofollow';
}
return $robots;
});
You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/
As for making sure that it returns a 404 response code, this is something you need to check with your theme provider as they handle the 404 template. Rank Math cannot control the 404 page.
With that said, setting them to noindex
should be enough if you are having trouble resolving the 404 response code.
Hope that helps.
Hello,
We are super happy that we could address your concern. 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.