How to cancel user accounts without e-mail confirmation?
Please use this code snippet it works for me 

 function simple_pass_reset_form_user_cancel_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  //  dsm($form);
  $form['actions']['submit']['#submit'][] = 'simple_pass_reset_user_cancel_form_submit';
}

function simple_pass_reset_user_cancel_form_submit(&amp;$form, &amp;$form_state) {
  $uid = $form['uid']['#value'];
  // exit;
  $user = \Drupal::currentUser();
  if (!$user-&gt;hasPermission('administer users') &amp;&amp; $uid == $user-&gt;id()) {
    // Hide "A confirmation request to cancel your account has been sent to your email address."
    $messages = drupal_get_messages('status', FALSE);
    if (!empty($messages['status'])) {
      unset($_SESSION['messages']['status']);
    }

    // Cancel the account, from user_cancel_confirm()
    user_cancel($form_state-&gt;getValues(), $uid, $form_state-&gt;getValue('user_cancel_method'));

    // Since user_cancel() is not invoked via Form API, batch processing needs
    // to be invoked manually and will redirect to the front page after
    // completion.
//You need to run batch process
    $batch = &amp;batch_get();
    $batch['progressive'] = FALSE;
    batch_process('');
  }
}