Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Disable Login With Email Address Feature in WordPress

Recently, one of our users asked us how they can the disable login with email feature introduced in WordPress 4.5. This feature allows users to login with username or email address in the login form. In this article, we will show you how to disable login with email address feature in WordPress.

How to Disable Login with Email Address Feature in WordPress

Why Disable Login With Email in WordPress?

Some users believe that email addresses are more common knowledge than a username. If you send an email to someone, then they already know your email address.

If someone wants to break into your WordPress site, knowing an email address could potentially make it easier for them to break in by guessing your password or hacking your email account.

We don’t believe that using an email address to login makes a WordPress site any less secure. You can always add more security layers like password protecting WordPress admin directory, and adding two-step verification.

For WordPress security, we use Sucuri on all our sites. See how Sucuri helped us block 450,000 WordPress attacks in 3 months

Having said that, we understand that some users may still want to disable login with email feature on their WordPress sites. Let’s see how you can easily do that.

Disable Login With Email in WordPress using a Plugin

First thing you need to do is install and activate the No Login by Email Address plugin. For more details, see our step by step guide on how to install a WordPress plugin.

The plugin works out of the box, and there are no settings for you to configure. Simply visit the login screen of your WordPress site and try login in with email address.

You will get an invalid username error. The plugin will also change label ‘Username or Email address’ to simply username.

Login with email address removed

Manually Disable Login with Email in WordPress

This method is simple but not very clean. Simply add this code to your theme’s functions.php file or a site-specific plugin.

remove_filter( 'authenticate', 'wp_authenticate_email_password', 20 );

It will not change anything on the login page and users will still see that they can login using either username or email address. But if they enter the email address to login, it will give them an invalid username error.

That’s all, we hope this article helped you disable login with email address feature in WordPress. You may also want to see our guide on how to disable login hints in WordPress login error messages.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

8 CommentsLeave a Reply

  1. Hi,

    Thanks for you article. I’m looking for a way to Login only By mail no Username.

    Thanks in advance for you help.

  2. Does this article also cover the registration form in woocommerce for the customers or it is only for the admin side login ?

  3. Somehow it isn’t clear to me how to add a username once the email address login is disabled. Can you please explain.

    Thanks so much

    • If you have user registration enabled on your site, then those users can still register using their email addresses. But they will not be able to use the email address to login. They will have to use the username to login. As an administrator, you will also need to enter an email and user name when adding a new user.

      Admin

  4. Thank you for article

    I want to know, how to allow login with mobile number

    Second, I want to register my customer without email in wordpress

    Please help me out with this

    Thanks

  5. I simply couldn’t go away your website prior to suggesting that I really loved the usual information an individual provide in your visitors? Is gonna be back frequently to check up on new posts

  6. I have a login to my wordpress blog. I have a different login for another wordpress blog I write with others. However when I want to comment on another wordpress blog. Neither user name or password works. I have not been willing to say change this long in because I am afraid it would affect the other 2. I don’t know what to call the 3 category to even look up the problem.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.