After getting this new blog up and running, I noticed one of the features that was added in version 2.5 of WordPress: revisions. It got me to thinking about how the database was impacted after moving all of those entries over. After running a query in the DB, the result came back with 1723 rows, yet I only have 684 entries. The rest (minus pages and attachments) were all revisions of blog posts and pages. Each revision is a full blog entry. Over time, that could add up to a lot of data, depending on how often you post entries and how many revisions you create in the process of each post.
First of all, it’s super easy to turn off revisions in WordPress 2.7. Just open the file wp-settings.php. In the code, look for the line below:
$default_constants = array( ‘WP_POST_REVISIONS’ => true );
Change the “true” to “false” and save the file. Okay that was simple and will keep revisions from being utilized. But what about the revisions that still exist in the database? That’s a little more involved. REMEMBER, before you do this, backup your MySQL DB first so you can easily restore it just in case you take out the whole thing by accident.
Since I run MySQL on a Windows machine (I know, go ahead and laugh) open up the MySQL query browser from Programs on the Start Menu. Then run the query below to take out all the revision entries of both posts and pages:
delete from wp_posts where post_type = ‘revision’;
That will do it.