[wp-trac] [WordPress Trac] #60362: Emojis cause "Updating failed. Could not update post in the database." error

WordPress Trac noreply at wordpress.org
Sat Nov 1 03:22:17 UTC 2025


#60362: Emojis cause "Updating failed. Could not update post in the database."
error
-------------------------------------------------+-------------------------
 Reporter:  mikefitzman                          |       Owner:
                                                 |  westonruter
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  6.9
Component:  General                              |     Version:  4.2
 Severity:  normal                               |  Resolution:
 Keywords:  has-test-info needs-testing has-     |     Focuses:
  patch commit                                   |
-------------------------------------------------+-------------------------
Changes (by westonruter):

 * keywords:  has-test-info needs-testing has-patch => has-test-info needs-
     testing has-patch commit
 * version:   => 4.2
 * component:  Database => General


Comment:

 I was able to reproduce the issue.

 I updated my `wp-config.php` to `define( 'DB_CHARSET', 'utf8mb3' );` and
 then reset the database to do a fresh install.

 I then tried creating a post with an emoji (🦬), and when attempting to
 save, I got an error banner. The REST API response was:

 {{{#!json
 {
     "code": "db_update_error",
     "message": "Could not update post in the database.",
     "data": {
         "status": 500
     },
     "additional_data": [
         "WordPress database error: Processing the value for the following
 field failed: post_content. The supplied value may be too long or contains
 invalid data."
     ]
 }
 }}}

 I tried applying the change from @kasparsd and it was able to save
 successfully.

 Note that the initial post content I saved was:


 {{{#!html
 <!-- wp:paragraph -->
 <p>Bison: 🦬</p>
 <!-- /wp:paragraph -->
 }}}

 And when I reloaded the edit post screen, the `post_content` was revealed
 to be:

 {{{#!html
 <!-- wp:paragraph -->
 <p>Bison: &#x1f9ac;</p>
 <!-- /wp:paragraph -->
 }}}

 So this is exactly as expected.

 The emoji also renders on the frontend as expected.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60362#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list