wordpress delete old post revisions improve site performance

wordpress tutorial, wordpress delete old post revisions improve site performance. We given sql commands and suggested some plugin for delete post revisions.

WordPress has auto save functionality. After some time wordpress creates the revision in database tables automatically. It is really useful. If something happens like powercut or browser crashes then you do not loose the your post data.

wordpress delete old post revisions improve site performance

SQL for delete post rivisions.



DELETE wp,wt,wpm FROM wp_posts wp LEFT JOIN wp_term_relationships wt ON (wp.ID = wt.object_id)
LEFT JOIN wp_postmeta wpm ON (wp.ID = wpm.post_id) WHERE wp.post_type = 'revision'

 
If you want to disable post revision system permanently, you can add following line in wp_config.php file.

define('WP_POST_REVISIONS', false);

 

But it has some bad issues also. If you have 5 to 10 revision per post and 200 posts then you will have at least 1500 to 2000 entries in table. Most important part is all revisions are unuseful. Each additional revision increase the size of your database thus making the processing time slower and slower.

But do not disable to auto save functionality and revision. you need to clean your db after certain time.

For cleaning the database you can use the following plugins.

  • 1. Optimize Database after Deleting Revisions –

http://wordpress.org/plugins/rvg-optimize-database/
This plugin is a ‘One Click’ WordPress Database Cleaner / Optimizer.

Main Features
Deletes redundant revisions of posts and pages (you optionally can keep an ‘x’-amount of the most recent revisions)
Deletes trashed posts, pages and comments (optional)
Deletes spammed comments (optional)
Deletes ‘orphan postmeta items’
Optimizes the database tables (optionally you can exclude certain tables from optimization)
Creates a log file of the optimizations (optional)
Optimization can be scheduled to automatically run once hourly, twice daily, once daily or once weekly at a specific time (optional)
‘Optimize DB (1 click)’ link in the admin bar (optional)
Settings
You can find the settings page in the WP Admin Panel » Settings » Optimize DB Options.

Starting the Optimization
You can start the Optimization in the WP Admin Panel » Tools » Optimize Database. Note: if you use the Scheduler the Optimization will run automatically!

  1. 2. Revision Removal – http://wordpress.org/plugins/revision-removal/

Revision Post is the new features of WordPress ver 2.6 and above. Every time you made a change to your post or page, it will automatic save add a revision, just like a draft. As many as you made change, the more revision you will have in your database. It will not only increase your database size, but also increase your load time as the server need more time to access the database.

Revision Manager is your choice to remove all the revisions quickly to help you to increase the speed of implementation of the SQL statement, and increase the speed of your server load.

wordpress delete old post revisions improve site performance

wordpress delete old post revisions improve site performance

One Comment

Add a Comment

Your email address will not be published. Required fields are marked *