How to remove "display name" from edit user I'm building a site that leverages the user email address for the user login instead of a username (via modules Logintoboggan  &amp; Email Registration). I'm also using Real Name to display the "first name" field of the user instead of the username. 

My solution is working perfectly apart from when the user is on the edit user account page (and some native drupal system notification message), which displays a "Display Name" field instead of the desired "first name" field.

Question: How can I remove/delete the "Display Name" field from the edit profile page and Drupal system messages/notification fields?
The first one was easy. To hide any field from the user edit form simply set the '#access' to this field to FALSE or any other logic you desire. The second one was more difficult. Turned out the display name was still used on the password reset page. That's how we finally solved it:

/**
 * Implements hook_form__alter().
 */
function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) { 

  if ($form_id == 'user_profile_form') { 
    $form['account']['name']['#access'] = FALSE; 
  } 

  if ($form_id == 'user_pass_reset') {
    // Here we take the corresponding user ID from the URL, second argument
    $user_id = arg(2);
    // Then we load the user
    $user = user_load($user_id);
    // Now we have the mail
    $user_mail = $user-&gt;mail;

    // extracting the date string with a helper function
    $sub_text = getContents($form['message']['#markup'], '&lt;em class="placeholder"&gt;', '&lt;/em&gt;');
    $expiration_date = $sub_text[1];

    // Now we alter the existing form
    $form['message']['#markup'] = '&lt;p&gt;This is a one-time login for &lt;em class="placeholder"&gt;'.$user_mail.'&lt;/em&gt; and will expire on &lt;em class="placeholder"&gt;'.$expiration_date.'&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;Click on this button to log in to the site and change your password.&lt;/p&gt;';
  }
}

/**
 * Helper function to extract a string between two given delimiters
 * Credit: http://stackoverflow.com/a/27078384/2199525
 */
function getContents($str, $startDelimiter, $endDelimiter) {
  $contents = array();
  $startDelimiterLength = strlen($startDelimiter);
  $endDelimiterLength = strlen($endDelimiter);
  $startFrom = $contentStart = $contentEnd = 0;
  while (false !== ($contentStart = strpos($str, $startDelimiter, $startFrom))) {
    $contentStart += $startDelimiterLength;
    $contentEnd = strpos($str, $endDelimiter, $contentStart);
    if (false === $contentEnd) {
      break;
    }
    $contents[] = substr($str, $contentStart, $contentEnd - $contentStart);
    $startFrom = $contentEnd + $endDelimiterLength;
  }
  return $contents;
}