Remove a Webform Submit Handler

Last updated on 04/06/2020
/** @var \Drupal\webform\Plugin\WebformHandlerManagerInterface $handler_manager */
$webformStorage = \Drupal::entityTypeManager()->getStorage('webform');
 
foreach ($webformStorage->loadMultiple() as $webform) {
  if ($webform->getHandlers()->has('email')) {
    $webform->deleteWebformHandler($webform->getHandler('email'));
    $webform->save();
  }
}