Credit for this tip goes to http://www.alexbarnettdesign.com/coding/removal-of-username-at-wordpress-register-page/.
WordPress needs a unique user name. But many people forget their user name and likes to login with their email id, which is easy to remember.
What we can do is create a function to generate a random user name and call that function as value for user name field. Then we can assign “hidden” type for the input field of user name.
Here is the function to generate random user name.
function generate_random_username($length = 6) {
$char = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x","y", "z");
$rand = array_rand($char, $length - 5);
$str = "";
foreach ($rand as $k => $v) {
$str .= $char[$v];
}
$str .= substr(time(), -5);
return $str;
}
Add the above code to function.php in your theme folder.
Edit type and value field of user_login in wp-register.php in the root folder.
Make type as hidden and value as echo generate_random_username(14)
14 is the length of user name.