• Resolved ferand

    (@ferand)


    Your plugin is great, it has so many advanced features, but one small not less important feature is missing. I have been searching for plugin with limit login attempts + notifications about error logins + that small feature for past 2 days, and have found none.

    The feature i am talking about works this way. If on login screen(wp-admin) you enter non-existing username – by default WordPress notify you that this login don’t exist, and if you enter existing login w/ wrong password you will get “bad password” error. Thus allowing hackers to determine what logins are exist and what are not. I don’t know if i am allowed to name other same functionality plugins on this forum, so i will not, but one small featured plugins allow you to show always same error like “wrong username/password” no matter existing/non-existing username you entered on login page.

Viewing 1 replies (of 1 total)
  • Thread Starter ferand

    (@ferand)

    This is magic. Happened so many times to me 🙂 Whenever i ask about problem on forum – no matter how long i’ve been searching for an answer before – i find a solution 1-5 mins after i post to forum or ask friend 😀

    So, for those with same problem. You can easily change error displayed to always be same(whether its incorrect username or password) by this small function. Add it to functions.php

    function my_custom_error_messages() {
          global $errors;
          $err_codes = $errors->get_error_codes();
    
          // Invalid username.
          if ( in_array( 'invalid_username', $err_codes ) ) {
             $error = '<strong>ERROR</strong>: Invalid username or password';
          }
    
          // Incorrect password.
          if ( in_array( 'incorrect_password', $err_codes ) ) {
             $error = '<strong>ERROR</strong>: Invalid username or password';
          }
    
          return $error;
       } add_filter( 'login_errors', 'my_custom_error_messages');
    • This reply was modified 6 years ago by ferand.
Viewing 1 replies (of 1 total)

The topic ‘Hide errors on login Screen’ is closed to new replies.