How to force users to register with only email address? I need force users to register on my site with just email only. I cannot use the Email Registration module. With this module, a username is generated and assigned based on the user name part of the email address. Subsequent users who have the same name (email prefix) are numbered sequentially. For example, "johndoe@exampleA.com" would be assigned username "johndoe", "johndoe@exampleB.com" would be assigned "johndoe001" and so forth..

The use case is that I have a number of subdomains that I am using Bakery on and need to ensure that there aren't any conflicting slave site accounts. The Email registration module will just create a tokenized username with appended unique IDs, creating conflicting accounts.

I figure by forcing email addresses, I can bypass most of this as an issue. How can I completely eliminate the username field and just use email field?
Use hook_form_alter to hide the username field

/**
 * Implementation of hook_form_alter.
 */
function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id){
  if($form['#form_id'] === 'user_register_form'){
    unset($form['account']['name']);
  }
}


Then you can use hook_user_presave to set the username using the convention you want (the md5 hash of the email is a good candidate):

/**
 * Implementation of hook_user_presave.
 */
function mymodule_user_presave(&amp;$edit, $account, $category){
  $edit['name'] = md5($edit['mail']);
}