WordPress change the incorrect error login message.

WordPress change the incorrect error login message. We can change the incorrect login error message using WordPress Hooks. Let’s how we can change the login error message using hooks.

By default, WordPress provides the message like below.

ERROR: The password you entered for the email address admin is incorrect.

This message is very useful to understand the “admin” user exists. So it’s necessary to change the incorrect error login message for making your WordPress secure.

So, Let’s see how we can change the incorrect error login message, first of all, open the filefunctions.php of your current theme. Write below hook on your functions.php file.

add_filter('login_errors','login_error_message');
function login_error_message($error){
    $pos = strpos($error, 'incorrect');
    if (is_int($pos)) {
        $error = "Wrong information";
    }
    return $error;
}

Set your custom login error message as you want.

If you face any issue after using this code write the comment below.