How to Fix the Character Encoding Problem in WordPress

Categories: Wordpress

I recently changed my web hosting again in an attempt to speed up the page load time of my website. I had to do it as the former hosting’s page response time was horrible. It was taking 9 seconds for my home page to load with the former hosting. Now my home page loads under 4 seconds! It’s amazing the difference it makes… now I don’t get angry when browsing my own site (I wonder what my visitors were thinking while waiting for the page to load!).

Anyway, The transfer was smooth but I had a slight issue that I noticed after the transfer. There were special characters similar to the following scattered throughout my blog posts:

special-char-example

I was pretty sure that this was a character encoding mismatch problem. I got a little scared thinking it would take a long time to fix but then I found a really easy way to solve it.

code-encoding-icon-275

Fixing the Character Encoding Mismatch Problem in WordPress

  • Open the ‘wp-config.php’ file in a text editor such as notepad (the wp-config.php file can be found on the directory where you installed WordPress).
  • Find the following two lines and comment them out:
define(‘DB_CHARSET’, ‘utf8′);
define(‘DB_COLLATE’, ”);

They should look like the following after you comment them out:

//define(‘DB_CHARSET’, ‘utf8′);
//define(‘DB_COLLATE’, ”);
  • Now upload the updated ‘wp-config.php’ file to your webhost.

This character encoding problem can happen after a database upgrade too so it doesn’t hurt to keep this trick in your mind just in case.

  • Share/Bookmark
Tags: Web development, web masters, Wordpress, Wordpress install

Similar posts that you may like

Subscribe to Tips and Tricks HQ to stay informed

twitter_icon

3 Comments (and one trackback)

  • #1 by George Serradinho on July 6, 2009 - 10:41 am

    I had that once when I backed up my database and then had to reload it as it was corrupt. At that stage I had a few posts so I actually ended up edit the posts one by one.

    I will remember this tip if it happens again.

  • #2 by Charles on July 16, 2009 - 1:28 pm

    What web host did you switch to?
    Your site is indeed faster now and I’m sure the web host plays a role.

    best,
    Charles

  • #3 by admin on July 16, 2009 - 8:36 pm

    Hi Charles, I switched to InMotion Hosting. Yeah so far I am happy with them. I really hate it when a webhosting company puts you on an overpopulated server and your site runs like a dog.

CommentLuv Enabled

Featured & Popular Articles

Tips and Tricks Hot Items

wordpress_estore_icon
wordpress membership plugin icon
infinity remix wordpress theme
wordpress_affiliate_plugin_icon