
Changing WordPress Login Error Messages to Remove Hints
- August 19, 2016
- Leave a comment
An error message is being displayed on the WordPress log-in page whenever a user enters an invalid username or password. These error messages can create problems and help hackers to find your username, password or email easily. In this article, you will learn a way to remove these hints from log-in page.
Following three can be the scenarios:
1- When a user enters an invalid username, WordPress will display the following error as shown in figure:
2- When a user enters an incorrect password but correct username, the following error is displayed as shown in figure:
3- When a user enters an incorrect password with correct email address, WordPress will show the following error as shown in figure:
Solution
If a hacker wants to guess your username/password/email, then the above mentioned error messages can easily confirm him that he will find them.
You can remove these log-in messages by adding the following code in your Theme‘s functions.php file:
1 2 3 4 |
function remove_wordpress_errors(){ return 'Something going to wrong!'; } add_filter( 'login_errors', 'remove_wordpress_errors' ); |
The above mentioned code will replace all the hints from log-in page. Now, If a user enters an invalid username, email or password, the following message will be displayed as shown in figure:
User Comments