diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index 91ad6f2286..ac9f24e6cd 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -2219,6 +2219,12 @@ class wpdb { foreach ( $columns as $column ) { if ( ! empty( $column->Collation ) ) { list( $charset ) = explode( '_', $column->Collation ); + + // If the current connection can't support utf8mb4 characters, let's only send 3-byte utf8 characters. + if ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) { + $charset = 'utf8'; + } + $charsets[ strtolower( $charset ) ] = true; }