Today what I thought would be a simple WordPress update turned into quite an adventure!  I was working on a WordPress site that I installed back in 2005 or so.  (Did they even make WordPress back then?  You bet they did!)  The WordPress software hadn’t been updated frequently.  The website had been hacked a few times and the customer finally agreed to have me update her software on a regular basis.

This was the first planned, regular update.  It was only going to take 15 minutes.  I thought it was going to be easy.  Nope.  But I did learn a lot.

The update went fine, then I started getting “Headers already sent” errors when I tried to log out.  I’ll spare you all the things I looked at and considered as I worked on this issue.  In the end I realized that the website’s wp-config.php file hadn’t been upgraded along with the WordPress software.   That’s just the way WordPress works.  It upgrades everything else, but there’s no way for it to automatically upgrade that particular file.  There’s a lot of new stuff in there.  Back in 2005 the config file only had 21 lines of code.  Now it’s up to 90.   One of the new sections in the configuration file is Authentication Unique Keys and Salts.  Those keys are a security feature that was added to WordPress after 2005.   Did I mention that this site had been hacked a time or two?

I took a new version of the wp-config.php file and added the website’s settings.  Goodbye error messages!  Because this is website development, a new problem popped up.  I was seeing a lot of strange characters in the pages and posts.  It had to be related to the new configuration file.

I changed this

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8'); 
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');


/** Database Charset to use in creating database tables. */
//define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
//define('DB_COLLATE', '');

No errors.  No strange characters.  And I think that I’ve taken care of the hacker problem to boot!

Leave a comment

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