Do Not Upgrade Your WordPress wp-config.php
ADVERTISEMENTSWhenever you install WordPress on a blog, you will need to modify the wp-config.php file to define the WordPress configuration settings required to access your MySQL database. However, you will not need to modify the file whenever you do a WordPress upgrade.
Recently I have been seeing strange characters appearing on many of my posts and some of the pages on this blog. I tried many things but could not find out the reason for this. Yesterday after reading this post on QuickOnlineTips, I realized the reason why I was seeing the strange characters. During a recent WordPress upgrade I had upgraded my wp-config.php file too as I had seen some new additions to it.
This is what I found added to the new wp-config file
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
Since WordPress Version 2.2, DB_CHARSET was made available to allow designation of the database character set to be used when defining the MySQL database tables.
Warning for those performing upgrades: If DB_CHARSET and DB_COLLATE do not exist in your wp-config.php file, DO NOT add either definition to your wp-config.php file unless you read and understand Converting Database Character Sets. Adding DB_CHARSET and DB_COLLATE to the wp-config.php file, for an existing blog, can cause problems — as Ryan Boren says, “your queries will go boom!”
source: Editing_wp-config.php
Since I had already added the two definitions to my wp-config.php file, I just commented it out and the strange characters seem to have gone
Have you upgraded your wp-config.php file and experienced the same problem?
Search JohnTP.com or view a random post
Related Articles
Find out what I am doing currently by .
Posted on November 19th, 2007 | Category: WordPress |
Ronald Huereca
November 20, 2007 at 6:24 am
I ran into the problem locally when I did a fresh 2.31 install and was testing out my Ajax Edit Comments plugin with various charsets. I couldn’t for the life of me figure it out and finally came across a few posts telling me to leave the charset empty.
I’d imagine this charset will only help out a minority of bloggers. I think WP goofed by giving it a default value.
Jude
November 20, 2007 at 2:07 pm
This is something I don’t understand though, why do you need to upgrade your wp-config.php? Usually you’ll just replace every other files apart from wp-config for an upgrade. No?
JohnTP
November 20, 2007 at 4:42 pm
Jude- You don’t need to upgrade your wp-config.php file
Madhur Kapoor
November 20, 2007 at 8:45 pm
I have never ever touched my wp-config file.