Home » Blog » Remove Helpful Info on WordPress Login Screen

Remove Helpful Info on WordPress Login Screen

WordPress can sometimes be over helpful such as telling you either your username or password was incorrect at login.

WordPress Login Error

Essentially WordPress is saying “Dear Mr Hacker, you have guessed the correct username but the password still needs some work.  Please try again. Love & kisses – WP“.

Hmmmmm…..  We need to sort that out straight away.

Add the following code to your functions.php file.

add_filter(‘login_errors’,create_function(‘$goaway’, “return null;”));

WordPress filters allow you to change a function’s output.

Here we are filtering the function “login_errors” which is used to display that oh-so-helpful information on the login screen and replacing it with our own custom function.

Our function accepts one input called $goaway which we don’t use but it needed  as a function parameter.

It then simply returns a null value which is the same as saying, do nothing.

Essentially we’re interrupting the info on it’s way to the login screen and making it display nothing.

Happy days!

Keep In Touch

Wil

Wil is a dad, consultant, developer, conference organiser, speaker and business mentor. He co-organizes the WordPress Sydney meetup group and has been on the orgnising committee for WordCamp Sydney since 2014. He speaks at many technical events and contributes to the WordPress open source project. His likes are chillies, craft beer and electrogravitics.
If You Enjoyed This Post
Join Our Newsletter
Give it a try, you can unsubscribe anytime.
Close