WordPress Perfectionist Beware
Getting your WordPress post just right takes a lot of time.
We all know that the editor has its quirks to say the least. By the time you have completed your 300 word article and then tweaked it for the 100th time you can end up with a lot of revisions.
If you are a perfectionist, you can have a very large database in no time. This can, in extreme circumstances, slow your site down.
Disable All Revisions
It is a shame that WordPress out of the box doesn’t have a way to turn on or turn off post revisions, or at the very least limit the number of revisions that will occur for each post.
They Gave Us ‘WP_REVISIONS’
Luckily, they have given us the ability to do both of those functions with the define(‘WP_POST_REVISIONS’), by either specifying ‘false’ or a number of revisions we want to keep for each post.
Use ‘false’ for No Revisions
//Disable the WordPress revisions feature.
define('WP_POST_REVISIONS', false);
I Want 8 Revisions for Each Post
// Set the number of WordPress revisions
// Here we have 8
define('WP_POST_REVISIONS', 8);
Edit the wp-config.php File
Yes, sadly, you must access the wp-config.php file via FTP, and edit it with a text-editor. If you need to ask what is a text-editor and what is FTP, then I would advise not doing this. Find someone who can help you.
Step 1: Select wp-config.php

Using your trusty FTP program select the wp-config.php file – duplicate it first for insurance – and get it up into your text-editor. You should have no difficulty finding it.
Step2: Edit wp-config.php

Put it Where?
Once you have wp-config.php in your editor, you need to put the
define( 'WP_POST_REVISIONS')
someplace. Don’t fret just look where there is a statement starting with define and put it on the line below it. Remember to put the ‘ ; ‘ at the end of the statement.
In the above example we are using ‘false’ to indicate we don’t want any revisions kept. If you do want revisions – but not an unlimited, database crushing amount – set a number that makes sense to you. Remember you can always go back in and modify this number at a later date.
Once you save your wp-config.php file, you are finished for the day.
Deleting ALL those Revisions
A revision is a WordPress built-in Post Type –
post_type = 'revision'
. Each revision is saved with all of the different types of post types in one big MySQL table. Deleting them is relatively simple but dangerous. Here is what the MySQL command looks like.
// Remember the 'wp_' is the standard WP prefix.
// Yours should be different than the standard 'wp_'
// for security purposes
DELETE FROM wp_posts WHERE post_type = 'revision';
Not too complicated, you say. You are correct, but you can really mess things up if you are not careful.
Ready for phpMyadmin?
If you have to ask “My php what“, then you are not ready. There is a way with the WP-DBmanager plugin to execute the MySQL command without having to use phpMyadmin. Go ahead and install this Swiss Army Knife for managing your database – it has only been downloaded over 400,000 times, you think it might be good?
Backup, Backup and Backup
After installing and activating WP-DBmanager, backup your database before trying any of its many functions. Once you have completed the backup, read deleting WordPress post revisions – Did I tell you to Backup your database?
If you are in a hurry, and don’t want to mess around with DELETE MySQL commands, look at the box below for a ‘no risk way to delete all of those revisions’.
Did You Know:
Get Rid of Those Revisions Manually
Afraid of playing around with the DELETE MySQL Command? Who could blame you?
There is a manual way to get rid of all those revisions without coming within a Texas mile of a MySQL command.
Insert the define(‘WP_POST_REVISIONS’, 5); into your wp-config.php file with the number of revisions you want to keep – say 5 as an example.
Next go to the Post edit main page and delete everything in your Trash.
Next click on Title and select all your posts on the page. Go to the ‘Bulk Actions’ drop down list and select ‘Move to Trash’. Click on ‘Apply’.
Do this until all your Post are in the Trash – of course you do have a fresh backup of your database don’t you?
Lastly, select ‘Trash’ and then click on Title to select all of your Trashed posts.
Select ‘Restore’ from the Bulk Actions drop down list and click on Apply.
Continue doing the process until all of your post are restored.
Now, everyone of your Post will have no more than 5 revisions