By default, WordPress displays an error message as soon as an incorrect entry is detected. However, this message is not customizable for WordPress site owners.
In today’s post we’ll cover how to display custom error messages for login forms in WordPress. In addition to instructions on how to customize your own error message, you’ll learn how to remove the login hints from the default messages.
Show custom error messages in WordPress admin login forms
By default, the error message is displayed based on the field that was entered incorrectly. For example, if you enter an incorrect username, the message “Unknown username. Check again or try your email address” is displayed. If you enter the correct username but not the password, an error message will also be displayed above the login form.

Although these detailed error messages can help you to find out where your input data was incorrect, they pose a potential risk as unexpected users can spy on your password hints and try to access your private area.

If this is the case, you should consider adjusting these messages to increase the security of your login form from suspicious visitors. If it is possible to know in which field the correct information has been entered, all they have to do is guess the rest.
So it’s time you knew how to customize the error messages for your admin login form. We’ll show you 2 easy ways to display custom error messages using either a custom code snippet or a plugin.
Customize error messages through custom codes
Simply add the following code snippet to the functions.php file of your theme.
function no_wordpress_errors(){
return 'Something is wrong!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );
The same error message “Something is wrong!” is displayed, regardless of whether you have entered the wrong user name, the wrong password or both.

Of course, you can change the error message as you wish. Simply replace the text “Something is wrong!” in the custom code with your own message.
Customize error messages with the LoginPress plugin
If you want to have more control over the error messages, using a plugin is a smart choice. In this tutorial, we’ll show you the LoginPress plugin, which you can easily find in the WordPress plugin directory and install for free.
Once it’s installed and activated, navigate to LoginPress > Customizer. A new screen will appear where you can see a variety of customization options. In this tutorial, we will focus on the Error Message section.

In this section, you can edit all error messages for specific cases. For example, incorrect user name, incorrect password, empty username, invalid password, and invalid email.

Once you have customized the WordPress login error messages, click on the “Publish” button at the top left. This will save your changes, which will then take effect immediately.
Click on the “X” icon in the top left corner to close the Customizer. Let’s assume we have changed the error message from the default message to a new error message as below.

If you try to enter an incorrect username or password, the error message will simply read “Something is wrong”
In addition, you can use the Custom Login Page Customizer|LoginPress plugin to customize the logo, background, registration form, forgot password form, ReCaptcha, and welcome message.
How to customize error messages in password-protected content forms
We’ve looked at how to manage error messages in the admin login form. Now let’s move on to the next section where you will get a complete guide on how to customize error messages in password protected content forms.
Customize error messages in forms with a password
If you want to protect your individual posts in WordPress with password forms and customize the error messages, don’t miss this section.
First, you need to protect your content with the Password Protect WordPress (PPWP) plugin, either in the Lite or Pro version. Then you can use the WordPress Customizer to customize the error messages.
Navigate to Appearance > Customize.

A new screen will appear. Scroll down and select PPWP Single Password Form > Error Message.

By default, the value is “Please enter the correct password” Here you can change the message as you wish.
Don’t forget to click the Publish button for all changes to take effect. Let’s assume we have changed the message to “Invalid password”. If someone enters an incorrect password, the error message is displayed as in the following image.
In addition, you can use the PPWP plugin and the WordPress Customizer to change not only the text, but also the font size, font weight, text color and background color.
Customize error messages for expired passwords
We have provided clear instructions on how to display error messages for all incorrect passwords, regardless of whether it is an invalid or expired password.
If you want to customize the expired password error messages, you may need to use our PPWP Pro plugin, the PPWP Suite extension and the WordPress Customizer.
Once you have installed and activated the plugins in your admin dashboard, go to Password Protect WordPress > Advanced.
Simply activate the “Customize Expired Password Message” option.

When users enter an expired password, they will receive the following message by default. You can change this message yourself using the WordPress Customizer.
- In your WordPress dashboard, go to Appearance > Customize.
- In the left sidebar, select Password protection for WordPress forms > Error message.
- Scroll to the bottom of this section to see the expired password message.
- Enter the desired message and click Publish.
- Let’s say we have changed the text to “Please enter an active password!”
Now if someone with an expired password accesses your protected content, they will receive this message.
Conclusion
Our article has shown you how to display custom error messages in WordPress. If you want to customize an error message on your admin login page, the supplied custom code or the LoginPress plugin will help you.
If you need to create error messages for password-protected content yourself, the PPWP plugin and the WordPress Customizer are the best choice.
If you want to customize error messages at a higher level, you should consider PPWP Pro and PPWP Suite to inform your users about expired passwords.