By default, WordPress allows users to log in either with an email address or username.
You need to add the following code to the functions.php file of your WordPress theme to disable login by username in WordPress.
php
/**
* Disable Login With Username in WordPress
*/
remove_filter( 'authenticate', 'wp_authenticate_username_password', 20 );