Show Customize error message in WordPress Login Page

Hello guys! Today I am going to show How to show Custom error message in WordPress Login page for security.

Add below code in the functions.php file of your theme.

function no_wordpress_errors(){
return 'Wrong Details Entered!';
}
add_filter( 'login_errors', 'no_wordpress_errors');

Problem with this default message is if anyone come on site and try with random username and password and is username is correct then it shows error like “The password you enter for the username admin is incorrect”.
You can check above screenshot left part image.

Sometimes this makes things easier for hackers. as they are now sure about the username.

After adding above code in functions.php file wordpress login error like display my screenshot.

Now if someone comes and try incorrect information in login page then WordPress would show the error ‘wrong details entered’ without giving any hints.

Blog Catagory : WORDPRESS