If you are not using post revisions (and if you do not know what they are, chance is you are not) I wholeheartedly recommend that you disable them and also remove all traces of them from your database.
In recent optimization work we did, I found tens of thousands of post revision records which related to 150MB of database space used on one and 60MB on the other site. Not only it's making your database clunky and slow but you are paying a price for a feature most users simply do not use. When this happens on high traffic site you are probably paying double price.
Time for action!
First step, disable post revisions. Edit your wp-config.php (WordPress configuration file, found in the root of your WP installation) and add this line:
Secondly we need to delete post revisions and associated data that is already in the database. So you will need access to your DB, either through command line 'mysql' or better with phpMyAdmin interface.
Select your database and execute this query:
DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = 'revision'
This will remove all revision posts and associated objects from the database. I recommend running OPTIMIZE tables command after (in phpMyAdmin just mark all tables and select Optimize) to compact your database. And that's all folks.
More like this:
- How to do a full WordPress backup and restore
- How to move WordPress site to new server with zero downtime
- How to toggle comments with one line of code
Posted in: WordPress
TAGS:can disable published wordpress, delete post revisions, disable revision comments wordpress, disabling deleting wordpress plugins, how disableposted bywordpress, post revisions, prelovac revisions, prelovac wordpress revisions, remove post revisions phpmyadmin, remove revisions wordpress, where post revisions, wordpress delete revisions, wordpress disable post delete, wordpress how remove revision, wordpress limit number revisions, wordpress post delete disable