Noindex Author Archives
Keeps author archive pages out of search results while their links are still followed, which suits single-author blogs where they duplicate the main blog.
Opens WPIDE on
Code
add_filter( 'wp_robots', function ( $robots ) {
if ( is_author() ) {
$robots['noindex'] = true;
$robots['follow'] = true;
}
return $robots;
} );
Notes
To remove author pages entirely, use a redirect instead.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.