Config Entities

Drupal 8: Delete view programmatically

If you should run into the same situation, that you'd like to delete a view programmatically, for example on module uninstall, here you go:

  1. \Drupal::service('config.factory')->getEditable('views.view.' . $view_name)->delete();