By default, WordPress lets users log in either with an email address or username.
You need to add the below code to your theme’s functions.php to easily disable login by email in WordPress.
php
/**
* Disable Login With Email Address in WordPress
*/
remove_filter( 'authenticate', 'wp_authenticate_email_password', 20 );