Recently, wordpress changed the default encoding for MySQL databases used in self-hosted wordpress installations from Latin to UTF-8. It’s a smart move and makes wordpress databases adhere to web standards, but the change caused some blogs to display some funky characters, that look like this “â€”.
For instance, on one of our older posts that was written before the change to the UTF-8 character encoding, an apostrophe was changed to the “â€” character. Check out the character encoding error below:
To check if your blog is affected by these odd characters, simply search your blog for “â€”. If posts with these funky characters show up, don’t panic! There’s a quick an easy fix that’ll replace these characters with the right characters.
UTF-8 Sanitize plugin to the rescue!
First, back up your database. Here at The 42nd Estate we recommend and use the WordPress Database Backup plugin, which will e-mail you a backup of your database. You can even schedule it to run automatically once a day for no hassle backups. Second, download the modified version of the UTF-8 Sanitize plugin. This modified plugin will go through your database, find these odd characters and replace them permanently. After downloading and activating the plugin, head to your Settings tab in your wordpress administration panel.
There you’ll see the below screen with three options; Outputting Posts, Saving Posts, and Process Posts.
You’ll want to select the Process Posts option, which will permanently update your database with fixes for the character encoding errors. Otherwise, you’ll need to keep the plugin installed permanently and it will update your posts on the fly. Since this can be a huge resource hog, it’s a much better idea to permanently fix your database. That way your posts don’t need to be updated each time a reader views them and you’re free to remove the plugin with no worries.
So, now that you’ve got a backup of your database, go ahead and select Process Posts and then click Update. The plugin will run for either a few seconds or a few minutes, depending on how many posts you have. It’ll then display a Settings saved message after it’s done running. Clear your cache (if you have a caching plugin installed, which we recommend) and then do another search for “â€” to make sure everything worked. Your MySQL database should now be free of character encoding errors but if not, leave a comment or send us an e-mail and we’ll be glad to try and help.