Archive

Posts Tagged ‘post revisions’

Customize WordPress Post Revisions

January 17th, 2010 7 comments

In a default install of WordPress, each time you edit a post or page, WordPress will automatically save your previous posts/pages allowing the possibility of reverting to a previous version of that post or page. This is a cool feature, but it can get a little ridiculous when you have dozens of previous versions sitting below the post–and taking up space in your db. As you can see in the following screenshot, with just a couple of edits to this post, I’ve already racked-up 4 revisions…by the time I finish editing, I’ll probably have a dozen or so…

Each of those revisions requires a separate record in the db. So, although this is a cool feature, it can significantly add to db bloat.  If you don’t really care to have all those revisions sitting around, or if you want to limit the number, WordPress does provide an option to change the default behavior allowing you to either disable revisions completely or allowing you to limit the number of revisions saved. To make these changes you do need to edit your wp-config.php file directly…currently, there is no option for doing this in WP admin.

Disable Post Revisions

To completely disable the revisions feature, add (or if already present) edit the following code to your wp-config.php file. The word (false) disables this feature.

define('WP_POST_REVISIONS', false );

Specify the Number of Post Revisions

If you want to keep the revisions feature, but limit the number revisions saved, then use the same code as above, but change false to the number of revisions you want to keep. In the example below, WordPress will keep the latest 3 post or page revisions.

define('WP_POST_REVISIONS', 3);

Get Adobe Flash playerPlugin by wpburn.com wordpress themes