WordPress Delete Revisions – How To Guide
This tutorial will teach you how to delete revisions in WordPress. WordPress Revisions is a fantastic tool provided by WordPress that saves all previous versions of posts or pages after you make any changes.
As a result, each time you make a change to your post or page and save it, WordPress creates a new revised version. And this revisions feature allows you to revert to a previous version of your post or page if you do not wish to continue with the current version.
Install and activate the WP-Optimize plugin. Now, navigate to the WP-Optimize->database dashboard by selecting it from the left panel. Select “clean all post revisions” from the dashboard. Now, besides the “clean all post revisions” check box, click the “Run Optimization” button. This will delete all revisions for all posts and pages in WordPress.
Let’s take a look at how to delete revisions in WordPress using a plugin and how to delete revisions in WordPress without using plunging, i.e. manually.
WordPress Delete Revisions – Using Plugin Step by Step Guide
Installing a plugin is all that is required to perform most WordPress tasks. It’s easy to remove a WordPress revision with the WP-Optimize plugin, which is available for free.
Make a backup of your website before cleaning up your database revisions to ensure that everything is still in order. Follow the below steps to install the WP-Optimize plugin.
- Go to the plugins page and select add new button.
- In the search box, search revisions.
- Install the plugin WP-Optimize and press activate once the installation is completed.
- Now, once activated select WP-Optimize on the left panel of the WordPress Dashboard.
- Select Database on the WP-Optimize options to Optimize the database.
- Now make sure that only “Clean All Post Revisions” is selected.
- Now either press the button “Run all selected optimizations” on the top or select the button “run optimization” on the side.
All of your post revisions and page revisions have now been deleted, and the majority of the items in your database have been cleaned up. After clearing the revisions, you may notice that WordPress revisions are not showing up.
Wait a few seconds and then begin saving your WordPress post. You will notice that revisions are being displayed for the new post as you save your post.
WordPress Delete Revisions – Without Using Plugin Step by Step Guide (Manual)
If you do notIf you prefer, you can also remove WordPress revisions manually. Using a plugin or deleting entries directly from the database are the two options. If you’re a developer, the second method is the better choice because it eliminates the need for another plugin.
To use the second, more advanced approach, you will need to log into phpMyAdmin and run a SQL query. It is critical to exercise caution when using this technique. In the WordPress repository forums, there are many bad snippets of code to be found.
Some of them may end up deleting something important from your website. Or, even worse, they can cause your website to go offline entirely.
Using a query, you can safely delete post revisions in WordPress. Log into your phpMyAdmin account, select your WordPress database from the left-hand panel, and then click on the SQL tab.
After that, you can enter a command that will be executed on your WordPress database. Enter the following commands in the command box:
DELETE FROM wp_posts WHERE post_type=”revision”;
We recommend that you use the prefix wp_ for your WordPress database instead of wp_. As soon as you’re done, click on “Go.” This means that all of the revisions you had in your database have been removed.
The WP-CLI command can also be used to remove post revisions from your site. WordPress-CLI commands like this one are possible:
$ wp post delete $(wp post list --post_type='revision' --format=ids)
When deleting previous versions of your database, keep in mind that this will not prevent WordPress from creating new versions of your pages and posts. As a result, limiting the number of saved revisions is a good idea in order to prevent them from becoming out of control in the future.
I hope you were able to delete revisions for your posts and pages in WordPress. It has two methods for deleting WordPress revisions listed. The first method is to use a plugin called WP-Optimize, and the second is to manually delete the WordPress Revisions using a SQL query or a WP-CLI command.
If you have any problems deleting the WordPress revisions, please let me know in the comments section and I will be happy to assist you as soon as possible.