Skip Navigation

If your site shows question marks for non-English characters, most chances are your database character encoding is different than UTF-8. Don’t worry, you can fix this easily.

If you’re using PHPMyAdmin, the structure of your wp_posts table should look something like this:

wp_posts viewed from PHPMyAdmin

If you see a different value for the collation, it means that the character encoding is wrong. This will cause text to display incorrectly because the browser doesn’t know how to show non-English characters.

How to Fix This Issue

First, make sure to backup your database.

All you need to do is run ALTER statements which will go through your data and change it from its current encoding to UTF-8. The easiest way to do this is by using the Database Collation Fix plugin.

In essence, your database needs to be adjusted using the following two SQL statements:

ALTER TABLE $table DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
ALTER TABLE $table CHANGE $field_name $field_name $field_type CHARACTER SET utf8 COLLATE utf8_bin

How to Prevent This from Happening Again

Finally, to make sure that you’re not skewing away from UTF-8 in the future, edit your wp-config.php file and set the charset definition correctly.

It should say:

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