Aleš Sýkora wrote

Emoji deleted from ACF field after saving

2. 4. 2021 in

So you have a ACF text field and you are trying to insert emoji to it. For example as a category icon. You add the field, add the emoji, use the PHP code to display the field. And emoji is missing.

After that you found that every time you save the page, emoji dissapear from the field. Why? Because you have wrong database character set. Go to your wp-config.php file on ftp and search for:

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

If there is DB_CHARSET set to utf8, you found the problem. You need to set your database to utf8mb4_unicode_ci.

Hot to do that?

I am not responsible for your crashed sites etc.. Please do a backup before!!

Change this line in wp-config.php to

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );

Then go to your WordPress database via phpMyAdmin and select your database. You can see your collation in column.

Collation column

Go to the edits and set Collations to utf8mb4_unicode_ci and change in all tables and table columns. Click on apply-

You are done 🙂 your emoji will stay in fields now.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

More from category
Aleš Sýkora wrote
Make slow YouTube embed faster with Toolset
12. 11. 2018 in
Speed up your Toolset website with YouTube embeded videos. Load them faster in a minute. Try it right with this tutorial.
Read More
Aleš Sýkora wrote
Tracking Toolset Forms in Google Analytics with Google Tag Manager
7. 8. 2018 in
What if you want to track your Toolset Forms submissions with Google Analytics Events? See how to do this with Google Tag Manager quickly.
Read More
Aleš Sýkora wrote
WooCommerce category clustered by child taxonomies in WordPress
6. 2. 2021 in
If you need to display your parent product category sorted by child taxonomies in clusters – for each child taxonomy it owns row – for example: Breakfasts Category Archive – Parent category Vegetarian – child category Product 1 Product 2 Vegan – child category Product 1 Product 2 Meat lovers – child category Product 1 […]
Read More
magnifiercross linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram