After you’ve been through the upgrade to WordPress 2.6 it says to post about the experience – so here I go. It went smoothly enough for me, but left me with two questions: 1) can I upgrade easily without the fear of overwriting my themes & plugins, and 2) Aaggh! How do I turn off post revisions!
With only two published posts and one draft under my belt, it wouldn’t exactly have been a catastrophe if I’d frapped it all up and lost my blog contents (although I had already backed up my database using Austin Matzko’s excellent WordPress database backup plugin
). But for anyone with an established, well visited site, an upgrade must be a far more nerve-wracking proposition.
Unless you’ve gone in and hacked some of the core files, a WordPress upgrade is essentially a case of downloading the new version and installing all the files to your web server exactly as they come – with a couple of exceptions: the wp-config.php file and the wp-content folder.
Themes & plugins folder
The wp-content folder is where you store your site’s theme and plugins. Unless you don’t use any plugins and you’re happy with either the default or classic WordPress themes, you don’t want to be overwriting this folder with what you download from WordPress.
In WordPress 2.6 you have the option to move where this folder lives on your server. This is great because – with the exception of the wp-config.php file – future upgrades will be a case of copying everything you’ve downloaded straight to your server, without fear of losing your themes or plugins. I also believe that it’s possible to move the location of the wp-config.php file too, though this I haven’t tried.
I found out about this on the Digital Inspiration post Things you can do after installing WordPress
. Unfortunately, the single line of code given as an example was wrong. There’s two new variables in WordPress 2.6 – one to set the directory location of the wp-content folder (WP_CONTENT_DIR) and one to set its URL (WP_CONTENT_URL). In the Digital Inspiration example, they had set the directory variable using a URL.
To get it right, put the following two lines in your wp-config.php file (changing the subfolder directory):
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/subfoldername/wp-content' );
define('WP_CONTENT_URL', 'http://www.yourdomain.com/subfoldername/wp-content');
It’s important that these lines go with the other ‘define’ lines in the config file. If I add things to scripts and files from elsewhere, I tend to put them in a bunch at the end of the document so I know where to look for them. But when I tried that I got a blank blog and a load of PHP errors when I logged in.
From what I’ve read, the downside of moving the wp-content folder is that many of the WordPress plugins hard-code the path to the wp-config.php file, which if you move your wp-content folder won’t be in the same relative position. If you’re using plugins, test them to see what breaks – it may be that you have to either disable your plugin(s) or move your wp-content folder back. Either way, it’s worth going back to where you got the plugin from as the author may have released a newer version compatible with WordPress 2.6.
Post revisions
Once I logged in and carried on with a draft post, I soon noticed one ghastly new feature of WordPress 2.6. Every time I saved the post, it saved a revision of it and put a link to view it at the foot of the page. Within the hour I had over 20 such links.
It turns out that each of these revisions is saved as a new line in the posts database. Now I don’t do concise, so this kind of thing could clog up my database very quickly. Plus, I’m the only author so there’s no editorial approval going on, other than what’s going on in my head.
There’s no built in way of turning this off, but you can stop it – again by adding a line to the wp-config.php file (and again with the rest of the ‘define’s):
define('WP_POST_REVISIONS', false);
If you’re not keen on editing the configuration file, there’s also a plugin from Exper Chaotic Flow
which allows you to disable post revisions, the WordPress autosave (which is less harmful as it doesn’t create a new database record), or both.
I called this post revision feature ghastly, but that’s a bit unfair. For me as a single author it’s unnecessary, and it would be far easier if you could just turn it off through the admin panel rather than fudging around with configuration files or plugins.
But for a blog with multiple authors and editors (and a very large database), I can see how it could be very useful. WordPress is clearly taking another step beyond the basic self-publishing platform, and heading towards collaborative publishing with more of the workflow tools you get with traditional content management systems. And that’s no bad thing at all..
Written by: Andy Bryant
Published on: 02 Aug 2008
Tags: blogging, content management, PHP, web development, WordPress
Leave a Reply