Publisher Theme BetterStudio
English
  • العربية
  • فارسی
  • Publisher Theme
  • WP Plugins
  • Blog
    • Learn WordPress
    • Learn Marketing
    • Learn Design
    • Learn Shopify
    • Login
    • Create Account
Download Publisher
Publisher Theme <
  • Publisher WP Theme
    • Features
    • Demos
    • Showcases
    • Changelog
    • Support
    • Documentation
    • Publisher vs Others
      • Newspaper vs Publisher
      • Soledad vs Publisher
      • Jannah vs Publisher
      • Good News vs Publisher
      • JNews vs Publisher
      • MagPlus vs Publisher
      • Newsmag vs Publisher
      • SmartMag vs Publisher
  • Pricing
  • WP Plugins
  • Blog
  • Login
  • Create Account
+
Download Publisher
English
  • العربية
  • فارسی
Learn WordPress
  • All
  • WP Tutorials
  • WP Plugins
  • WP Themes
  • WP Hostings

How to Delete WordPress Old Revisions?

WordPress revisions can take up a lot of space in your database. With a free plugin you can delete WordPress old revisions. Here is how.

September 28, 2019
0

Revisions are simply the older drafts of your post, saved in the WordPress database. To delete WordPress old revisions install the WP-Sweep plugin. Then go to Tools > Sweep and clean the revisions. You can also limit revisions or just disable them, using the methods below.

Revisions are a great way to undo changes in WordPress posts. Although Some of these revisions will never be used and they’re only wasting database space. A single post in WordPress can have several revisions.

Every time you make changes to your post, a new revision gets created and stored in your database. As we said, the more posts you have, the more revisions there will be. So to empty out your database it’s crucial to delete some of your revisions.

Old websites don’t need to save their revisions. Imagine a website with 1000 pages or posts, if each of them has several revisions, imagine how much of your database you have to dedicate to these revisions. In this article, we will discuss different ways to delete WordPress revisions.

Table of Contents
How to Delete All WordPress Old Revisions?
How to Disable WordPress Revisions with Code?
How to Limit WordPress Revisions?
How to Change Autosave Interval in WordPress?
How to Delete WordPress Revisions from Database?

How to Delete All WordPress Old Revisions?

Most WordPress tasks can be easily done by installing a plugin. To delete WordPress revision, you can install the free WP-Sweep plugin.

Remember to get a backup of your WordPress database in case anything goes wrong.

To delete WordPress old revisions take these steps:

1. Go to Plugins > Add New

2. Search for WP-Sweep, install and activate it

3. Go to Tools > Sweep

4. In front of ‘Revisions’ click on Sweep

How to Disable WordPress Revisions with Code?

To disable WordPress revisions forever, you will have to head over to your WordPress dashboard and locate the wp-config.php file from your WordPress directory and copy and paste the code below to the top:

define( 'WP_POST_REVISIONS', false );

This code will disable your WordPress revisions and they won’t be stored in your database. The “false” value disables it. In the future, if you wish to enable your WordPress revisions simply change the value to “true” and save it.

define( 'WP_POST_REVISIONS', true );

To delete all of your revisions from your database you need to run this MySQL query:

DELETE FROM `wp_posts` WHERE `post_type` = "revision" AND `post_name` LIKE "%revision%"

This code will delete WordPress revisions stored in your database.

How to Limit WordPress Revisions?

Instead of fully disabling or deleting your revisions, you may want to limit the number of revisions stored on your database.

First, open your wp-config.php file, because you will need to add some code to it. Copy and paste the code below above “ABSPATH”. If it’s not copied above “ABSPATH” it will not work.

define('WP_POST_REVISIONS', 3);

You can replace “3” with any number you would like. For example, if the number is set to 3, your posts will only have 3 revisions and any new revisions will replace old ones.

This option is very beneficial for people who have limited database space and still want to use this feature. You can also use “Perfmatters” plugin to limit the number of revisions per post.

How to Change Autosave Interval in WordPress?

You can also change your autosave interval. If you wish to set an exact time, you could do so by adding the code below to your wp-config.php file:

define('AUTOSAVE_INTERVAL', 600 );

By default, autosave is 1 minute in WordPress. You can change that number. Here we have changed it to every 10 minutes. This will autosave your revisions every 10 minutes.

Although, this code cannot delete your old revisions stored in your database. Auto-delete revisions can be very useful when you don’t have access to the internet. You can use WP-Revisions control and WP-Sweep for more features.

How to Delete WordPress Revisions from Database?

Although, running a MySQL query is very fast and simple but still some users prefer to use plugins. This way you don’t need any programming knowledge. Thus, the risk of you breaking your database is slim. The Revision Control plugin allows its users to have more control over their WordPress revisions.

Users can disable or activate revisions with one simple click. It also allows its users to manage the revisions stored in their database.

Better Delete Revision is also another plugin that can be used to delete old WordPress revisions stored in your database. Most webmasters and programmers use this plugin. Both of these plugins are totally free to use.

Please Share This:

Leave a Reply Cancel reply

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

Publisher Theme

All-in-one WordPress Theme for Magazines, Newspapers and Blogs

WordPress Publisher Theme For Newspaper and magazine and blog Get Publisher
Content Protector

Prevent content copiers from copying your website texts, images, videos, and source code

Protect Your Content
  • Home
  • Blog
  • 📙 WordPress Tutorials
  • How to Delete WordPress Old Revisions?
Get the Latest Tutorials by Subscribing to Our Newsletter
Subscribe to our newsletter to be notified on new post and product releases.
BetterStudio
  • Contact us
  • Advertise
  • Custom Development Services
  • Blog
Products
  • Publisher Theme
  • Better Ads Manager
  • Our Plugins
Useful Links
  • 30 Days Refund Guarantee
  • Refund Request Form
  • BetterStudio Affiliates
  • Affiliate Payout Request
Support
  • WPShield
  • Publisher Theme
Connect
  • Follow on Twitter
  • Join us on Facebook
  • Follow on Instagram
Copyright © 2023 — BetterStudio. Terms & Conditions — Privacy Policy