- Status
- Resolved
Overview of the issue
If you are using a page builder in your website, you may notice that if you add some emojis in a block of content, that block won’t be available for translation in the Advanced Translation Editor or Classic Translation Editor.
Workaround
This issue appears because of a table collation conflict. If your server supports the collation utf8mb4_general_ci, you can follow this procedure after making a full backup of your site:
- Open your theme’s functions.php file.
- Add this code:
// Notice admin_init - will only run in backend add_action('admin_init', function() { require_once(ABSPATH.'/wp-admin/includes/upgrade.php'); global $wpdb; $mytables=$wpdb->get_results("SHOW TABLES"); foreach ($mytables as $mytable) { foreach ($mytable as $t) { maybe_convert_table_to_utf8mb4( $t ); } } }); - Visit any page in your site’s backend.
- Remove the code.
Your database tables collation should be utf8mb4_general_ci now, and the content will be available for translation.
In case your site’s database is using latin1 collation, you could apply the following workaround instead:
- Make a full backup of your site before proceeding.
- Go to: https://github.com/interconnectit/Search-Replace-DB.
- Download the ZIP file of the project and unzip it.
- Upload the unzip folder to your WordPress installation using a FTP client.
- Visit the folder – e.g. http://example.com/Search-Replace-DB-master/
- Fill out your database name, server, user and password. You can obtain those values from your wp-config.php file.
- Click and test the connection.
- Go to the bottom and click on the button ”Convert to UTF8MB4“.
- Wait for the process to finish.
- Once this is done click ”Delete me” button