Title: Customize Login Error Message
Last modified: May 21, 2019

---

# Customize Login Error Message

 *  Resolved [bethimc](https://wordpress.org/support/users/bethimc/)
 * (@bethimc)
 * [7 years ago](https://wordpress.org/support/topic/customize-login-error-message/)
 * We are wondering if we can customize the login error message. Ideally, we want
   to give a warning to valid users that they only have X number of login attempts
   left before their account is locked. Barring that, we could just say they have
   a maximum of X attempts before their account is locked.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [7 years ago](https://wordpress.org/support/topic/customize-login-error-message/#post-11557327)
 * Hi, unfortunately at present there is no feature available in the plugin to customize
   the message displayed by WordPress.
 * Kind regards
 *  Plugin Contributor [wpsolutions](https://wordpress.org/support/users/wpsolutions/)
 * (@wpsolutions)
 * [7 years ago](https://wordpress.org/support/topic/customize-login-error-message/#post-11557680)
 * Hi [@bethimc](https://wordpress.org/support/users/bethimc/),
    Yes I think you
   can achieve what you want using the wordpress core filter for the errors.
 * Here’s one way you could do it by putting something like the following in your
   theme’s functions.php file:
 *     ```
       add_filter('login_errors', 'filter_login_errors', 10, 1);	
       function filter_login_errors( $error ) {
       	if (empty($error)) return $error;
   
       	$warning = '<br />You have 3 login attempts in total.';
   
       	return $error .= $warning;
       }
       ```
   
 * The above will append the following message to whatever error is displayed:
 * “You have 3 login attempts in total.”
 * This is just a quick example to demonstrate how you could do it but I recommend
   that also do your own due diligence and you could add some extra checks such 
   as checking the existing error string to see what the error message is and change
   your response accordingly.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Customize Login Error Message’ is closed to new replies.

 * ![](https://ps.w.org/all-in-one-wp-security-and-firewall/assets/icon-256x256.
   png?rev=2798307)
 * [All-In-One Security (AIOS) – Security and Firewall](https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [wpsolutions](https://wordpress.org/support/users/wpsolutions/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/customize-login-error-message/#post-11557680)
 * Status: resolved