Top Ad unit 728 × 90

Delete Posts Revisions from Your Database


WordPress has a lot of good features and one of them is Post Revisions. This was included in WordPress 2.6, even though this is a good feature, it can cause some problems. One of them is increase the size of your database. Depending on how long it takes you to write a post, you might have as many as fifty post revisions. Now you can manually delete them, or you can run a simple query which we will show you in this post and get rid of all these useless revisions.
First thing you need to do is login to your phpMyAdmin and select your WordPress Database.
Click on the SQL Button and enter the following query:
1DELETE FROM wp_posts WHERE post_type = "revision";
In this code basically we looked up a table wp_posts and removed every post that had a post_type revision associated with it. Now depending on the size of your database, this may save you a lot of space.
If you also want to disable the post revision system, you can add this line near the bottom of your wp_config.php file.
define('WP_POST_REVISIONS', false);
You can also save only the last 3 revisions by adding following code to wp-config.php:
define(‘WP_POST_REVISIONS’, 3);
Delete Posts Revisions from Your Database Reviewed by Unknown on 10:43 PM Rating: 5

No comments:

All Rights Reserved by Boca Raton Real Estate © 2014 - 2015
Powered By Blogger, Designed by Sweetheme

Contact Form

Name

Email *

Message *

Powered by Blogger.