Simple Revisions Delete adds a discreet link within a post submit box to let you delete your posts revisions individually or all at once (purge or bulk action). Compatible with Gutenberg (experimental since v1.5) and classic editor.

What is a “revision”?

A revision is an earlier version of a post, which is created when you edit a post to keep track of its contents before changes. It is be used to create a change history that allows you to go back in time and see previous edits. It is called content versioning.

Why this plugin?

When I work on WordPress sites I tend to save drafts, do post updates, typo corrections (a few too many…), etc. In short, when you work on the content of a site, especially when it is under construction, you tend to save often to watch what happens in front, but each time you update, a new revision of the post is created and a new entry is stored in the database. Basically, imagine that you have 100 posts you have edited 10 times: 100 * 10 = 1,000 registered posts in the database. This represents 900 potentially unnecessary entries that affect the loading time of the site and increase the size of the database.

What does it do?

It helps you keep a clean database by removing unnecessary posts revisions. Unlike other similar plugins, it lets you delete only specific posts revisions, not all your site revisions at once. The plugin is perfectly integrated in the WordPress back-end, and uses native core functions to safely delete revisions.

To remove all the revisions at once, I suggest you to use this cool plugin:  Better Delete Revision.

EXTRA: In case you don’t already know, WordPress provides an out-of-the-box option to specify the maximum number of revisions to store for each post. As explained in the CODEX, you can easily achieve that by pasting this simple line in your wp-config file.

define( 'WP_POST_REVISIONS', 3 );

How does it work?

The plugin adds a discreet link in the post submit box, next to the default revisions counter. When you click on it, it purges the appropriate post revisions via AJAX (No-JS is also supported).

It also adds a bulk action option (see bulk actions dropdown select) in the post/page list view to let you purge revisions of multiple posts at once.
Since v1.3 you can delete a single revision at once (see screenshots).

NOTE: There is no admin page for this plugin – none is needed.

What’s new?

Since v1.5 you can now purge all your posts revisions from within the Gutenberg editor.
Keep in mind that this feature is experimental. I haven’t yet find any way to make it works in a proper way with the current block editor available methods. I’m using jQuery (and AJAX) which is pretty much a hack (a workaround) and not a clean method considering the langages using by the Block Editor.

Since v1.3 you can delete a single revision at once (see screenshots).

Post Types support

The default supported post types are post and page, but you can easily add custom post types or remove default post types with the following hook:

function bweb_wpsrd_add_post_types( $postTypes ){
	$postTypes[] = 'additional-cpt';
	$postTypes[] = 'another-cpt';
	return $postTypes;
}
add_filter( 'wpsrd_post_types_list', 'bweb_wpsrd_add_post_types' );

Support for all of your site custom post types, using the Core function get_post_types()

function bweb_wpsrd_add_post_types( $postTypes ){
 return get_post_types();
}
add_filter( 'wpsrd_post_types_list', 'bweb_wpsrd_add_post_types' );

Custom user capability

The default capability to purge or remove rivisions is delete_post, but you can override this with the following hook:

function bweb_wpsrd_capability() {
	return 'edit_post';
}
add_filter('wpsrd_capability', 'bweb_wpsrd_capability');

Screenshots

simple-revisions-delete-screenshot-1

simple-revisions-delete-screenshot-2

simple-revisions-delete-screenshot-3

simple-revisions-delete-bulk-action-b-web

simple-revisions-delete-individual-b-web

screenshot-6

Languages

The plugin includes just a few sentences, but you can easily translate them through .MO & .PO files. Currently available languages are:

Become a translator and send me your translation! Contact-me

 

Post written byBrice CAPOBIANCO

WordPress addict and self-taught. I love to learn and to create, then to share…
Founder of bweb.
Share this post

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

Show 8 comments

8 comments

  1. Hi Hugues,
    You have to open the tab at the top right of your screen “Screen Options”, then check “Revisions”.
    Keep in mind that if you don’t havec any revision on the current post, you won’t see this list.
    Best,

  2. Hi

    I cannot display the list of revisions for a page like on your screenshot. I would like delete versions one by one after checking them.
    How do you display all the revisions in a list ?

    Hugues

  3. WordPress 4.7.3 running Porto theme – I like this plungin but with the template I get this message…. Untested with your version of WordPress. Could you test to make sure I can add to WordPress 4.7.3 version?