Block Author URL Enumeration
Redirects ?author=N query string requests to the homepage to prevent user account enumeration.
PHPby SnipCraft
php
<?php
add_action( 'template_redirect', function () {
if ( isset( $_GET['author'] ) && ! current_user_can( 'manage_options' ) ) {
wp_redirect( home_url( '/' ), 301 );
exit;
}
} );#enumeration#hardening#security#users