Want to block all posts of spacific author via robots.txt file
You should use the robots_txt filter to exclude all of the URLs of posts written by specified author (untested): add_filter( ‘robots_txt’, static function ( $output ) { $query = new WP_Query( array( ‘author’ => 3, ‘posts_per_page’ => -1, ‘no_found_rows’ => true, ‘fields’ => ‘ids’, ) ); if ( ! $query->have_posts() ) { return $output; } … Read more