diff --git a/core/modules/config/src/Tests/ConfigImportAllTest.php b/core/modules/config/src/Tests/ConfigImportAllTest.php
index 1624211..ced8a96 100644
--- a/core/modules/config/src/Tests/ConfigImportAllTest.php
+++ b/core/modules/config/src/Tests/ConfigImportAllTest.php
@@ -69,7 +69,10 @@ public function testInstallUninstall() {
 
     $fields = \Drupal::entityManager()->getStorage('field_config')->loadMultiple();
     \Drupal::entityManager()->getStorage('field_config')->delete($fields);
-    // Purge the data.
+    // Purge the data. Need to call this twice to actually remove all the
+    // fields. First time around will purge the instances. Second time will
+    // delete the instances and fields.
+    field_purge_batch(1000);
     field_purge_batch(1000);
 
     system_list_reset();
diff --git a/core/modules/filter/src/Entity/FilterFormat.php b/core/modules/filter/src/Entity/FilterFormat.php
index 944d5c7..94a5bb3 100644
--- a/core/modules/filter/src/Entity/FilterFormat.php
+++ b/core/modules/filter/src/Entity/FilterFormat.php
@@ -97,7 +97,7 @@ class FilterFormat extends ConfigEntityBase implements FilterFormatInterface, En
    *
    * An associative array of filters assigned to the text format, keyed by the
    * instance ID of each filter and using the properties:
-   * - plugin_id: The plugin ID of the filter plugin instance.
+   * - id: The plugin ID of the filter plugin instance.
    * - module: The name of the module providing the filter.
    * - status: (optional) A Boolean indicating whether the filter is
    *   enabled in the text format. Defaults to FALSE.
@@ -194,8 +194,17 @@ public function preSave(EntityStorageInterface $storage) {
 
     $this->name = trim($this->label());
 
-    // @todo Do not save disabled filters whose properties are identical to
-    //   all default properties.
+    // Remove disabled filters which have default configuration.
+    $this->filters = array_filter($this->filters, function($filter) {
+      $default = \Drupal::service('plugin.manager.filter')->getDefinition($filter['id']);
+      if (!$filter['status']) {
+        // Compare the current settings to the default settings. If there are
+        // any customisations save them to configuration.
+        $diff = array_diff($filter, $default);
+        return !empty($diff);
+      }
+      return TRUE;
+    });
   }
 
   /**
