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?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 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’.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0