In my few recent posts, I used to save the same post over and over again and have also updated quite a few times upon publishing the posts. The bad thing is that under the Publish module, I get to see how many revisions I have made to the same post.
I was wondering if the data was getting stored for my previous posts and when I checked I had like 12MB of storage space for several posts which obviously would eat up my bandwidth and I am paying for the bandwidth. So continued usage or updating the same post over and over again will add up to the cost of bandwidth.
Hence I decided to eliminate/disable post revisions and also to delete the existing revisions storage from my hosting disk space.
Very few people know this and act on to disable and delete post revisions in WordPress. You have got a chance to know and implement it to avoid using more bandwidth and disk space. So to save money, act now.
Time for action!
Step 1 – Disable Post Revisions
Edit your wp-config.php (WordPress configuration file, found in the root of your WP installation) and add this line:
Step 2 – Delete Post Revisions
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. I would prefer it through PhpMyAdmin found in your cPanel.
If you have no idea what database is being used by your blog, then open wp-config.php and look for a line that says define(‘DB_NAME’, ‘********’);
The field marked with ******** is your database.
Select your database within PhpMyAdmin 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'
If the above code doesn’t work. You could also use the code below:
DELETE FROM wp_posts WHERE post_type = "revision";
This will remove all revision posts and associated objects from the database.
And that’s all folks.
Disclaimer: I am not suggesting that ‘Post Revisions’ is a bad option. This tutorial is only for those who are in the situation where they need to reduce their database size and to save money on bandwidth.
Did you find this post useful and would you want to save money. Express your views in the comments.