Delete Batches of Post Revisions in Wordpress?

BillEssley

Well-known member
Registered
Joined
Feb 19, 2013
Messages
358
Points
28
How can I delete batches of post revisions in Wordpress? My WP created more post revisions and I would like to delete them, it is making me annoy when reading post revisions on font end.
 

FerdieQO

Well-known member
Joined
Jul 15, 2016
Messages
213
Points
28
There are many useful features in WordPress, and one of them is the Post Revision feature. This is already in WordPress versions, although this is a useful feature, it may cause some problems. One of them is to increase the size of your database as it will have to save the editing history. Depending on how long you have been writing a post, you can edit the post dozens of times and then archive the entire revision history will become problematic. Now you can manually delete them, or you can run a simple query that we will show you in this article and delete all revision.

The first thing you need to do is log in to phpMyAdmin and select your WordPress database.

Click the SQL button and enter the following query:

Code:
DELETE FROM wp_posts WHERE post_type = "revision";
In this code, let's look at the wp_posts table and remove all posts that already have a revision post_type associated with it. Now depending on the size of your database, this can save you much space.
 

VirtuBox

Well-known member
Registered
Joined
May 3, 2016
Messages
1,622
Points
83
How can I delete batches of post revisions in Wordpress? My WP created more post revisions and I would like to delete them, it is making me annoy when reading post revisions on font end.
Hello,
You can limit the amount of revisions for each post by adding the following line in your wp-config.php :
PHP:
define( 'WP_POST_REVISIONS', '5' );
 
Recommended Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top