Change login error messages

you can do that using login_errors filter hook and here is how:

add_filter('login_errors','login_error_message');

function login_error_message($error){
    //check if that's the error you are looking for
    $pos = strpos($error, 'incorrect');
    if (is_int($pos)) {
        //its the right error so you can overwrite it
        $error = "Wrong information";
    }
    return $error;
}

update:

i just tested the code and it works fine just pasted the code in my theme’s functions.php file without changing anything with the .po file

enter image description here

Leave a Comment