diff --git a/block_visibility_groups.install b/block_visibility_groups.install
new file mode 100644
index 0000000..606ebfd
--- /dev/null
+++ b/block_visibility_groups.install
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * @file
+ * Install, update and uninstall functions for the block_visibility_groups module.
+ */
+
+/**
+ * Implements hook_uninstall().
+ */
+function block_visibility_groups_uninstall() {
+  // Remove the 'condition_group' condition from all blocks.
+  /** @var \Drupal\Core\Entity\EntityStorageInterface $block_storage */
+  $block_storage = \Drupal::service('entity_type.manager')->getStorage('block');
+  /** @var \Drupal\block\Entity\Block[] $blocks */
+  $blocks = $block_storage->loadMultiple();
+  foreach ($blocks as $block) {
+    $conditions = $block->getVisibilityConditions();
+    if ($conditions->get('condition_group')) {
+      $conditions->removeInstanceId('condition_group');
+      $block->save();
+    }
+  }
+}
diff --git a/src/Tests/VisibilityTest.php b/src/Tests/VisibilityTest.php
index 21be8c1..51be21c 100644
--- a/src/Tests/VisibilityTest.php
+++ b/src/Tests/VisibilityTest.php
@@ -83,6 +83,14 @@ class VisibilityTest extends BlockVisibilityGroupsTestBase {
     $this->assertText($block->label(), 'Block shows up on page node.');
     $this->drupalGet('user');
     $this->assertNoText($block->label(), 'Block does not show up on user page.');
+
+    $this->container->get('module_installer')->uninstall(['block_visibility_groups']);
+
+    // After uninstall conditions will not apply.
+    $this->drupalGet('node/' . $page_node->id());
+    $this->assertText($block->label(), 'Block shows up on page node.');
+    $this->drupalGet('user');
+    $this->assertText($block->label(), 'Block shows up on user node.');
   }
 
   /**
