diff --git a/src/wp-includes/class-wpdb.php b/src/wp-includes/class-wpdb.php
index d9186b91f4..a9f694e6d4 100644
--- a/src/wp-includes/class-wpdb.php
+++ b/src/wp-includes/class-wpdb.php
@@ -2593,25 +2593,28 @@ class wpdb {
 			return false;
 		}
 
-		$formats = array();
-		$values  = array();
-		foreach ( $data as $value ) {
+		$formats     = array();
+		$values      = array();
+		$identifiers = array();
+		foreach ( $data as $identifier => $value ) {
 			if ( is_null( $value['value'] ) ) {
 				$formats[] = 'NULL';
 				continue;
 			}
 
-			$formats[] = $value['format'];
-			$values[]  = $value['value'];
+			$formats[]     = $value['format'];
+			$identifiers[] = $identifier;
+			$values[]      = $value['value'];
 		}
 
-		$fields  = '`' . implode( '`, `', array_keys( $data ) ) . '`';
+		$fields  = implode( ', ', array_fill( 0, count( $identifiers ), '%i' ) );
 		$formats = implode( ', ', $formats );
 
-		$sql = "$type INTO `$table` ($fields) VALUES ($formats)";
+		$sql      = "$type INTO %i ($fields) VALUES ($formats)";
+		$prepared = array_merge( array( $table ), $identifiers, $values );
 
 		$this->check_current_query = false;
-		return $this->query( $this->prepare( $sql, $values ) );
+		return $this->query( $this->prepare( $sql, $prepared ) );
 	}
 
 	/**
