29.01.2025

Website maintenance

How do I fix the error in the Gutenberg editor "Update failed" or "Publishing failed"?

If you receive the error message "Update failed" or "Publish failed" when saving or publishing a post in the WordPress Gutenberg editor and your text contains special characters such as emoticons, this could be due to an incorrect database configuration 🙀!

In this article, I will show you step by step how to fix the problem.

Cause of the problem: Is the character set correct?

The character set utf8mb3 (or also utf8 ) only supports characters with up to three bytes. However, emojis and many special characters require four bytes. If your WordPress database is still on utf8mb3 is set, saving an emoticon will result in an error message.

Solution: Conversion of the database to utf8mb4

Step 1: Backup!!!!

As always, before operating on database structures, create a complete backup of your database. We assume that you have access to the "PHPMyAdmin" tool.

  1. Log in to phpMyAdmin.
  2. Select the affected database.
  3. Click above on "Export".
  4. Select the "Quick" option and click on "OK"to download the SQL file.

Step 2: Check the character set of the database

  1. Open phpMyAdmin and select your WordPress database.
  2. Go to the tab "Operations".
  3. Check under "Collation"whether the character set utf8mb3_general_ci or another obsolete character set is used.
This database still has the old character set

Step 3: Change character set

Change database character set

  1. In the tab "Operations" the new character set utf8mb4_unicode_ci from.
  2. Activate the option "Change collation for all tables" and click on "OK".
Tick the "Change all table collations" and "Change all column collations" checkboxes

If not all tables or columns have been automatically adapted to the new character set

  1. Go back to the overview of your tables.
  2. Click on a table (e.g. wp_posts) and open the tab "Operations".
  3. Change the character set to utf8mb4_unicode_ci.
  4. Repeat this step for all relevant tables (e.g. wp_comments, wp_options).

Sometimes individual columns need to be adjusted:

  1. Open the table and go to the tab "Structure".
  2. Edit columns with text content (e.g. post_content, post_title) and change their collation to utf8mb4_unicode_ci.

Step 4: Customise the WordPress configuration

Make sure that your file wp-config.php specifies the correct character set:

  1. Open the file wp-config.php in the root directory of your WordPress installation.
  2. Search for or complete the following lines:
   define(DB_CHARSET', 'utf8mb4');
   define(DB_COLLATE', 'utf8mb4_unicode_ci');Code language: JavaScript (javascript)
  1. Save and upload the file again.

5. reminder: clear cache / reload editor

Clear the cache of your website (if available) and the browser cache to ensure that the changes take effect.

If your Gutenberg editor is still open, reload the article using the "Refresh" function of your web browser

Check whether the problem has been resolved

Now try again to save or publish a post with emojis or special characters:

  • Open the Gutenberg editor and insert an emoji into a paragraph.
  • Save or publish the post.

If everything has been done correctly, the problem should be solved.

Conclusion

The error message "Update failed" in the Gutenberg editor can be caused by an outdated database configuration, in particular by the character set utf8mb3. With the switch to utf8mb4 not only ensure that emojis are supported, but also make your website future-proof.

🤖

And if all this is too much effort for you, then simply call a website gardener 👩‍🌾

See also

All other contributions

What are FAQs? What are they used for?

The FAQ are explanatory texts in the form of an "interview". If there is a question here about the products or services of MaiNetCare, we will provide the answer...

How can I integrate my own calendar on the website?

Sometimes you don't want to maintain everything twice and three times. You have a public calendar on Google or Apple or Microsoft Office or - very commendably - in your own NextCloud and want to keep it...

What is DKIM?

DKIM is an Internet technology designed to make email communications more credible by showing whether emails really come from who they appear to come from, and that the content of the email "in transit" is not...