I want to do it as a security precaution. I've already taken other actions. But I want to be able to login only with my admin username. Is there a way to do that or even a plugin?

  • Just FYI, some users don't like plugin suggestion questions. Your best bet is editing the question to focus on the coding side of making changes. Dec 14, 2020 at 17:12

1 Answer 1


Yes, you can disable login by email by removing the specific authenticate filter:

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

from a plugin or your theme's functions.php. This won't update the UI though, which will still say 'Username or Email Address'.

  • Hey @Rup, so I just add this line to my theme's functions.php? Dec 14, 2020 at 11:44
  • Yes, that would work. Assuming it's your own theme: if it's something that'll autoupdate then that this line would get lost when it does. You could also make a very simple plugin or mu-plugin with just this too.
    – Rup
    Dec 14, 2020 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.