diff --git a/core/modules/views/src/Entity/View.php b/core/modules/views/src/Entity/View.php
index 1e9fac1..3cc18d3 100644
--- a/core/modules/views/src/Entity/View.php
+++ b/core/modules/views/src/Entity/View.php
@@ -7,6 +7,7 @@
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\views\Plugin\DependentWithRemovalPluginInterface;
 use Drupal\views\Views;
 use Drupal\views\ViewEntityInterface;
 
@@ -468,4 +469,40 @@ public function invalidateCaches() {
     \Drupal::service('cache_tags.invalidator')->invalidateTags($tags);
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function onDependencyRemoval(array $dependencies) {
+    $result = FALSE;
+    $current_display = $this->getExecutable()->current_display;
+    $handler_types = Views::getHandlerTypes();
+
+    // Find all the handlers and check whether they want to do something on
+    // dependency removal.
+    foreach ($this->display as $display_id => $display_plugin_base) {
+      $this->getExecutable()->setDisplay($display_id);
+      $display = $this->getExecutable()->getDisplay();
+
+      foreach (array_keys($handler_types) as $handler_type) {
+        $handlers = $display->getHandlers($handler_type);
+        foreach ($handlers as $handler_id => $handler) {
+          if ($handler instanceof DependentWithRemovalPluginInterface) {
+            if ($handler->onDependencyRemoval($dependencies)) {
+              unset($this->display[$display_id]['display_options'][$handler_types[$handler_type]['plural']][$handler_id]);
+              $result = TRUE;
+            }
+          }
+        }
+      }
+    }
+
+    // When we had to make any kind of change, disable the view.
+    if ($result) {
+      $this->disable();
+    }
+
+    $this->getExecutable()->setDisplay($current_display);
+    return $result;
+  }
+
 }
diff --git a/core/modules/views/src/Plugin/DependentWithRemovalPluginInterface.php b/core/modules/views/src/Plugin/DependentWithRemovalPluginInterface.php
new file mode 100644
index 0000000..5cca152
--- /dev/null
+++ b/core/modules/views/src/Plugin/DependentWithRemovalPluginInterface.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace Drupal\views\Plugin;
+
+/**
+ * Provides an interface for a plugin that has dependencies that can be removed.
+ *
+ * @ingroup plugin_api
+ */
+interface DependentWithRemovalPluginInterface {
+
+  /**
+   * Allows a plugin to define whether it should be removed.
+   *
+   * If this method returns TRUE then the plugin should be removed.
+   *
+   * @param array $dependencies
+   *   An array of dependencies that will be deleted keyed by dependency type.
+   *   Dependency types are, for example, entity, module and theme.
+   *
+   * @return bool
+   *   TRUE if the plugin instance should be removed.
+   *
+   * @see \Drupal\Core\Config\Entity\ConfigDependencyManager
+   * @see \Drupal\Core\Config\ConfigEntityBase::preDelete()
+   * @see \Drupal\Core\Config\ConfigManager::uninstall()
+   * @see \Drupal\Core\Entity\EntityDisplayBase::onDependencyRemoval()
+   */
+  public function onDependencyRemoval(array $dependencies);
+
+}
