Title: Hide errors on login Screen
Last modified: May 24, 2020

---

# Hide errors on login Screen

 *  Resolved [ferand](https://wordpress.org/support/users/ferand/)
 * (@ferand)
 * [6 years ago](https://wordpress.org/support/topic/hide-errors-on-login-screen/)
 * 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](https://wordpress.org/support/users/ferand/)
 * (@ferand)
 * [6 years ago](https://wordpress.org/support/topic/hide-errors-on-login-screen/#post-12883034)
 * 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](https://wordpress.org/support/users/ferand/).

Viewing 1 replies (of 1 total)

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

 * ![](https://s.w.org/plugins/geopattern-icon/wp-cerber_77a9bf.svg)
 * [WP Cerber Security, Anti-spam & Malware Scan](https://wordpress.org/plugins/wp-cerber/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cerber/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cerber/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cerber/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cerber/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cerber/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [ferand](https://wordpress.org/support/users/ferand/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/hide-errors-on-login-screen/#post-12883034)
 * Status: resolved