Code to Disable “Login Hints” in WordPress Login Error Message

/* Disable Login Hints in WordPress */
function wpflt_disable_wp_loginerrors(){
  return 'Contact Admin if you Forgot Password';
}
add_filter( 'login_errors', 'wpflt_disable_wp_loginerrors' );

Add this code to your child theme’s functions.php to stop WordPress exposing your username. Even if you enter the right username with wrong password, WordPress will only display the message you add in third line of the code.

Previously, when you enter right username and wrong password, WordPress shows a message saying the password entered for the ‘username‘ is wrong. This made easy for the intruders to know your username. When this code is added, WordPress wont expose your username anymore.