How to Hide WordPress Login Error Messages

How to Hide WordPress Login Error Messages

Hiding WordPress login error messages can be helpful if you don’t want to reveal to users that they’ve used the wrong username or the wrong password.

The message that says “Invalid username” could potentially help a hacker in his search for the right username and password.

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

You can easily hide these messages by adding the following snippet to your theme’s functions.php file. This tip comes to you courtesy of Shahzad Saeed who posted it over at isitwp.com:

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

This will help your site be a little more secure in the face of a direct hacking attempt.