Hide Login Error WordPress

Yesterday we saw how to Customize the WordPress Login. Today we're going to finish it Hiding the Login Errors.

Today's tip is something you should always add to all your WordPress projects.

When you type a wrong password it tells you Hey, wrong password!. Also tells you when you just entered a wrong username.

The point is we can not let the bad guys know what are they writing wrong.

There is an easy solution. Add this line to your functions.php in your theme folder.

add_filter('login_errors',create_function('$a', "return 'Ops!';"));

You can also customize the error message πŸ˜‰

About Rick

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

Leave a Reply

Add <code> Some Code </code> by using this tags.