Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Disable Login With Email Address Feature in WordPress

Ever notice how your WordPress login page accepts both usernames and email addresses?

While this flexibility can be helpful, some website owners prefer to keep things simple and only allow username-based logins.

You might want this for consistency, easier user management, or to match your brand’s approach to user authentication.

The great thing about WordPress is that you can customize almost everything, including how people access their accounts. Many site owners don’t realize they can easily control which login methods are available on their site.

In this guide, we’ll show you how to disable the email login feature and switch to username-only authentication.

How to Disable Login with Email Address Feature in WordPress

Why Disable Login With Email in WordPress?

Disabling the email login feature is a simple way to harden your website’s security.

Your email address is often more public than your username. If a hacker knows your email, they already have half of the information they need to try and access your site.

By forcing users to log in with a username only, you reduce your site’s ‘attack surface.’

This means an attacker would need to guess both a specific username and a password, making it more difficult for them to break in.

Having said that, we understand that some users may still want to disable login with email feature on their WordPress sites. Here are 2 methods for how you can easily do that:

Let’s dive right in.

Method 1. Disable Login with Email in WordPress using Code (Recommended)

This method involves adding a code snippet to your site.

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

While you could add this code directly to your theme’s functions.php file, we strongly recommend against it.

Editing this file directly can break your site if not done perfectly, and any changes you make will be erased the next time you update your theme.

The safest and easiest way to add code is by using the WPCode plugin. It prevents these problems and makes managing code snippets simple for beginners.

WPCode's homepage

It has a built-in library with ready-to-use code snippets for all of the most popular WordPress feature requests, including disabling login with email, removing the WordPress version number, disabling comments, and more.

We have thoroughly tested the tool on our demo website and have found it to be super beginner-friendly. To learn more, see our detailed WPCode review.

First, you need to install and activate the free WPCode plugin. If you need help, you can read our tutorial on how to install a WordPress plugin.

Once the plugin is activated, you’ll want to go to Code Snippets » Library from your WordPress admin dashboard.

Next, you can search for the ‘Disable Login by Email’ snippet and click on the ‘Use snippet’ button.

Search for the Disable Login by Email snippet in WPCode library

Then, WPCode will automatically add the code snippet and select the proper insertion method.

Here’s what it might look like in the WPCode editor:

WPCode automatically adds the code for disabling login by email

From here, all you need to do is toggle the switch from ‘Inactive’ to ‘Active.’

Then, go ahead and click the ‘Update’ button.

Activate and update snippet in WPCode

That’s it!

This will not change anything on the login page, and users will still see that they can log in using either a username or email address. But if they enter the email address to log in, they will receive an invalid username error.

Method 2. Disable Login With Email in WordPress using a Plugin

If you prefer not to add code snippets, then you can use a plugin instead.

This method is a great alternative for users who want a simple plugin that does this one job without any extra settings to configure.

For this, you need to install and activate the No Login by Email Address plugin. For more details, feel free to refer back to our step-by-step guide on how to install a WordPress plugin.

The plugin works out of the box, which means that there are no settings to configure. Simply visit your WordPress site’s login screen and try logging in with your email address.

Login with email address removed

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

Frequently Asked Questions About Disabling Email Logins

Here are some common questions we get asked about disabling the email login feature in WordPress.

Why should I disable email logins in WordPress?

Disabling email logins adds a simple but effective layer of security to your website. Since usernames are not as publicly known as email addresses, it makes it more difficult for attackers to guess login details.

This is particularly helpful for websites with many users, such as online stores, membership sites, or multi-author blogs.

Will this affect my existing users?

Yes, but the change is straightforward. Your existing users will no longer be able to log in with their email address and will need to use their username instead.

We recommend sending out an email to inform your users about this update to prevent any confusion or login issues.

What if a user forgets their username?

Even with email logins disabled, users can still click the “Lost your password?” link on the login page.

WordPress sends the recovery link to their registered email address, and that email will typically include their username as a reminder.

Is disabling email login enough for strong website security?

No, this is just one piece of the puzzle. True website security comes from a layered approach.

We always recommend using strong passwords, adding two-factor authentication, and installing a reliable WordPress security plugin for the best protection. To get started, you can take a look at our ultimate WordPress security guide.

That’s all, we hope this article helped you disable login with email address feature in WordPress. Next, you may also want to see our guide on how to disable login hints in WordPress login error messages and our tutorial on adding security questions to the WordPress login screen.

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. Here's our editorial process.

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

9 CommentsLeave a Reply

  1. Since using an email address poses a security risk for me, especially because my email address is listed on the blog, I tried using method one with WP Code. It seems the least complicated and doesn’t burden the website in any way. Since I take access security to the admin area seriously, I find it important to disable the use of an email address and only use a login, preferably with two-factor authentication as well. The method with WP Code works perfectly.

  2. Hi,

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

    Thanks in advance for you help.

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

  4. 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

  5. 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

  6. 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

  7. 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.