how to remove password confirmation field in user registration form?
The following code works for me in Drupal 7.

/**
 * Implements hook_form_FORM_ID_alter().
 */
function MODULE_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    $form['account']['pass']['#type'] = 'password';
    $form['account']['pass']['#title'] = 'Password';
}


Please note that the user registration form and the user profile form both have password confirmation fields and are not the same form.  You will need to alter both forms if you wish to remove all password confirmation fields.