How to remove current password field in drupal?

    To remove current password field in drupal just place this form alter in any custom module this will remove field and its validation also
    function <modulename>_form_alter(&$form, $form_state) {
      unset($form['account']['current_pass']);
      unset($form['account']['current_pass_required_values']);
      $form['#validate'] = array_diff($form['#validate'], array('user_validate_current_pass'));
    }
    5
    Average: 5 (1 vote)