Weird Characters

Weird characters in WordPress posts

Sometimes after you migrate a wordpress website you will see all your posts and/or pages with some strange symbols or weird characters. Those characters are because the new database is in the wrong schema.

There are proper ways to fix this, which involves creating a new database and migrating all the data. But don’t worry, if you only want to fix this using the easy and fastest way to show a product to a client, this way only will take you about 3 minutes. This easy way will only give you headaches when you have a multisite installation of wordpres, otherwise you will be OK.

What do you have to do to fix those weird characters?

In order to fix this you need edit access to the wp-config.php file (found in your main blog directory). You only need to comment the lines below:

define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

Comment them out like this:

//define('DB_CHARSET', 'utf8');
//define('DB_COLLATE', '');

And problem solved!

UPDATED 20150909: In the latest update of WordPress this issue with the weird characters seems to be solved, and also, if you commented the lines above you should get another error. If you get an empty editor when try to edit a post or a page, just remove the commented lines and it should be fixed. Goog luck!

Leave a Reply

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