Quick Fix: Strange characters appearing when using apostrophe etc

Posted in: Newsmag
Post count: 34

If you recently upgraded to wordpress 4.5.1 from earlier versions you may have found your posts have been all messed up with lots of Â, †and ™ characters dotted everywhere. This happened to HallaNaija blog posts, I manually removed them from some of the affected posts but was unable to do that to all because i have too over 5000+ published posts. I didn’t spend any time looking into what caused this to happen.

I immediately came to the forum for support and i’ve also contacted the in-house staff support team but didn’t get any response. However I decided to look into the problem further as there are a lot of wordpress users who are having problems with this.

What causes these characters to appear after upgrading?

WordPress added two new lines to the wp-config.php file in version latest version

define(‘DB_CHARSET’, ‘utf8’);
define(‘DB_COLLATE’, ”);

In brief, DB_CHARSET lets you define the character set which is used on your blog and DB_COLLATE lets you set the order of the character set. I don’t want to go into too much details about these new variables as it will not concern the majority of wordpress users.

So why does this problem arise? Well, if you install a fresh copy of wordpress you may get this problem however. This is because the wordpress upgrade does not convert the old Latin1 character set to the new UTF-8 character set during the upgrade. I’m baffled why wordpress did not speak more about this when they released new version as it’s clearly something that is going to cause problems for a lot of bloggers.

How do you remove these strange characters from your posts?

There are a few ways you can fix this problem.

Remove the references to DB_CHARSET and DB_COLLATE in the wp-config.php file

– If you simply remove the new lines from your wp-config.php file your posts should be back to normal. In the long term though it’s maybe best to convert your database.
OR
You can:
– Download the wordpress UTF-8 Database Converter plugin – g30rg3x released a wordpress plugin called UTF-8 Database Converter which converts your database and therefore removes all strange characters from your posts. You can download it here [ https://wordpress.org/plugins/utf-8-database-converter/ ]. All you need to do is backup your database, upload this plugin and then activate it. When you have activated it and selected the converter in your plugin tab you will see this screen. ==> http://tinyurl.com/hn5adru
Don’t get too alarmed about this screen, just double check that you have backed up your blog database so if anything happens your covered.

Removing or commenting out the DB_CHARSET and DB_COLLATE references in your wp-config.php file is definately the quickest way to resolve this problem but I’ve no doubt that future versions of wordpress will include these new character variables so it might be worthwhile converting your database using the plugin I mentioned.

I hope that this guide will help wordpress users who have had problems with this. If you are unsure about anything please let me know and I will do my best to help.

thanks, HallaNaija

Post count: 22421

Hi,
Thank you for posting this solution. I’m sure it will help lots of people who have this issue.

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newsmag’ is closed to new topics and replies.