1

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?

1
  • 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. – Matthew Brown aka Lord Matt Dec 14 '20 at 17:12
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'.

2
  • Hey @Rup, so I just add this line to my theme's functions.php? – Kostas Gogas Dec 14 '20 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 '20 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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