WordPress remove login errors

Learn how login errors can be harmful to the security of your site and how you can fix them.

A login error occurs when a user enters an invalid username or password on your site’s login page. WordPress will give your user a detailed error message if they entered an incorrect name / password combination. Detailed information is great for users but can be harmful to your site. A hacker can use the information to validate that certain accounts exist on your site and target them specifically.

To remove the errors from being displayed and increase your site’s security you can add the following code to your functions.php file.

//Remove WordPress error messages on login page
function remove_errors(){
    return '';
add_filter('login_errors', 'remove_errors')