Hi Todd,
Before using Rank Math, we were using Yoast, and the author archives were set to noindex, both globally and individually.
It’s since switching to Rank Math that the author archives are set to index.
I just confirmed by turning off Rankmath and turning on Yoast, and they set back to noindex again. So I re-imported Yoast settings to Rankmath, but the author archives are still set to index.
So I don’t know where Rankmath is picking up the setting to index the current author pages, as they have never been set that way.
-
This reply was modified 5 years ago by Max Peters.
Hello,
It looks like Rank Math is incorrectly setting robots’ value to index when robots data is not set in the Yoast plugin.
I’ve forwarded this issue to the Development team, they will further debug this and release an update soon.
For now, to set author pages to noindex please add below filter code in your theme’s functions.php file:
add_filter( 'rank_math/frontend/robots', function( $robots ) {
if ( is_author() ) {
$robots['index'] = 'noindex';
if ( isset( $robots['max-snippet'] ) ) {
unset( $robots['max-snippet'] );
}
if ( isset( $robots['max-video-preview'] ) ) {
unset( $robots['max-video-preview'] );
}
if ( isset( $robots['max-image-preview'] ) ) {
unset( $robots['max-image-preview'] );
}
}
return $robots;
});
I hope that helps. 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.