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

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Recently, one of our users asked us how they can disable the login with email feature introduced in WordPress 4.5.

This feature allows users to log in with a 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 log in 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.

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

This method requires you to add code to your WordPress files. If you haven’t done that before, see our guide to pasting snippets from the web into WordPress.

To disable the login with email feature, you need to add this code to your theme’s functions.php file or a code snippets plugin.

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

To make it even easier, you can use WPCode, the best code snippets plugin for WordPress.

WPCode WordPress code snippets plugin

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

The best part is that you don’t need to edit your theme’s functions.php file at all.

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

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

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

WPCode automatically adds the code for disabling login by email

All you need to do is toggle the switch from ‘Inactive’ to ‘Active.’

Then, 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 username or email address. But if they enter the email address to log in, it will give them an invalid username error.

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

You can also disable the login with email feature with a single-use plugin.

The 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 your email address.

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

Login with email address removed

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 and our picks for the best WordPress login page plugins.

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.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

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. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. momses says

    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. Dom WO says

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

  4. Debra says

    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

    • WPBeginner Support says

      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. Abdul Samad says

    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. Jeramy Queale says

    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. Jayna Coppedge says

    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 to WPBeginner Support Cancel 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.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.