diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 4875f4b..feb135a 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -774,6 +774,7 @@ function variable_initialize($conf = array()) {
  *   The value of the variable.
  *
  * @see variable_del()
+ * @see variable_del_prefix()
  * @see variable_set()
  */
 function variable_get($name, $default = NULL) {
@@ -796,6 +797,7 @@ function variable_get($name, $default = NULL) {
  *   of serialization as necessary.
  *
  * @see variable_del()
+ * @see variable_del_prefix()
  * @see variable_get()
  */
 function variable_set($name, $value) {
@@ -818,6 +820,7 @@ function variable_set($name, $value) {
  * @param $name
  *   The name of the variable to undefine.
  *
+ * @see variable_del_prefix()
  * @see variable_get()
  * @see variable_set()
  */
@@ -833,6 +836,52 @@ function variable_del($name) {
 }
 
 /**
+ * Unsets any persistent variables with a given name prefix.
+ *
+ * Use this function to delete variables that share a common prefix in
+ * their name. For instance: Variables named mymodule_foo and
+ * mymodule_bar would both be deleted by a call to
+ * variable_del_prefix('mymodule_');
+ *
+ * Case-sensitivity of the variable_* functions depends on the database
+ * collation used. To avoid problems, always use lower case for persistent
+ * variable names.
+ *
+ * @param $name
+ *   The name of the variable prefix to undefine.
+ *
+ * @see variable_get()
+ * @see variable_set()
+ * @see variable_del()
+ */
+
+function variable_del_prefix($prefix) {
+  global $conf;
+
+  // Minimal sanity check.
+  if ($prefix != '') {
+    $query = db_select('variable', 'v');
+    // Query for the variables to delete.
+    $result = $query
+      ->condition('v.name', $prefix . '%', 'LIKE')
+      ->fields('v', array('name'))
+      ->execute();
+    // Gather the variable names in a handy array.
+    $names = $result->fetchCol();
+    // Loop through and delete each variable.
+    // Also unset the variable from $conf.
+    foreach ($names as $name) {
+      $delete_query = db_delete('variable')
+        ->condition('name', $name)
+        ->execute();
+      unset($conf[$name]);
+    }
+    // Clear the variables cache.
+    cache_clear_all('variables', 'cache_bootstrap');
+  }
+}
+
+/**
  * Retrieve the current page from the cache.
  *
  * Note: we do not serve cached pages to authenticated users, or to anonymous
