diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index 62281eb2356581979d370824ba937611d67dc177..079e936a1e45d4fe23bd958d1483da71f42b5f07 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -720,7 +720,7 @@ function _taxonomy_depth($depth, $graphic = '--') {
 
 function _taxonomy_prepare_update($data) {
   foreach ($data as $key => $value) {
-    $q[] = "$key = '". check_query($value) ."'";
+    $q[] = "$key = '". str_replace('%', '%%', check_query($value)) ."'";
   }
   $result = implode(', ', $q);
   return $result;
@@ -732,7 +732,7 @@ function _taxonomy_prepare_insert($data, $stage) {
   }
   else {
     foreach (array_values($data) as $value) {
-      $q[] = "'". check_query($value) ."'";
+      $q[] = "'". str_replace('%', '%%', check_query($value)) ."'";
     }
     $result = implode(', ', $q);
   }
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 62281eb2356581979d370824ba937611d67dc177..079e936a1e45d4fe23bd958d1483da71f42b5f07 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -720,7 +720,7 @@ function _taxonomy_depth($depth, $graphic = '--') {
 
 function _taxonomy_prepare_update($data) {
   foreach ($data as $key => $value) {
-    $q[] = "$key = '". check_query($value) ."'";
+    $q[] = "$key = '". str_replace('%', '%%', check_query($value)) ."'";
   }
   $result = implode(', ', $q);
   return $result;
@@ -732,7 +732,7 @@ function _taxonomy_prepare_insert($data, $stage) {
   }
   else {
     foreach (array_values($data) as $value) {
-      $q[] = "'". check_query($value) ."'";
+      $q[] = "'". str_replace('%', '%%', check_query($value)) ."'";
     }
     $result = implode(', ', $q);
   }