WordPress 2.6 added post revisions as a new feature that is turned on by default. In an earlier post, I described how you could control this by editing wp-config.php and there are a number of plugins that purport to provide the same level of control through the administration screens. Even so, I decided to look at things from the housekeeping side of things and create my own plugin for clearing the database of revisions at one swoop. Currently, it takes out all revisions but I am thinking of adding the facility for selecting which revision to keep and which to delete. It goes without saying that you should back up your database first in case anything might go wrong.
Archive for the ' administration screens' Tag
WordPress plugin for removing post revisions from database
Controlling the post revision feature in WordPress 2.6
This may seem esoteric for some but I like to be in control of the technology that I use. So, when Automattic included post revision retention to WordPress 2.6, I had my reservations about how much it would clutter my database with things that I didn’t need. Thankfully, there is a way to control the feature but you won’t find the option in the administration screens (they seem to view this as an advanced setting and so don’t want to be adding clutter to the interface for the sake of something that only a few might ever use); you have to edit wp-config.php yourself to add it. Here are the lines that can be added and the effects that they have:
Code: define(’WP_POST_REVISIONS’,'0′);
Effect: turns off post revision retention
Code: define(’WP_POST_REVISIONS’,'-1′);
Effect: turns it on (the default setting)
Code: define(’WP_POST_REVISIONS’,'2′);
Effect: only retains two previous versions of a post (the number can be whatever you want so long as it’s an integer with a value more than zero).
Update (2008-07-23): There is now a plugin from Dion Hulse that does the above for you and more.
Tags
Adobe Apache Blog Blogging Books Canon Command Line CSS DSLR Firefox Google Hardware HTML IE7 Installation Internet Explorer JavaScript Linux Microsoft MySQL Opera Operating System Oracle Perl Photoshop Photoshop Elements PHP Safari SAS SQL Ubuntu UNIX VirtualBox Virtualisation Virtual Machine Vista VMware Web Browsers Windows Windows XP WordPress WordPress.com WordPress plugins XHTML XP
-
January 2009 S M T W T F S « Dec 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Monthly Archives
-
Photo Gallery
Here are a few teaser photos from my online photo gallery.