Enable, Disable and Delete Posts Revisions in WordPress

Post Revisions are automatically created revision content for your posts. Whenever you save a post or a page, the old version is retained so you can revert back at any time. Older revisions are never deleted so you always have a full history of all page changes. Automatic posts saving feature will be helpful when your post deleted accidently. You can revert to previous version of post any time you want. However every revision requires a separate row in WordPress’s posts table and perhaps multiple entries in the postmeta and term_relationships tables. Removing older revisions will free up disk space and ease MySQL’s processing burden.

Disable/Enable Post Revisions:

By default WordPress enables post revision settings. But you can disable or re-enable it any time. Simply follow these simple steps:

  • Login to your hosting account and open File Manager.
  • Go to your sites WordPress installation directory and open wp-config.php file.
  • Now add this code in this file:
    define(‘WP_POST_REVISIONS’, false);
  • Save the changes.

Post Revision feature is now disabled permanently. To re-enable it simply replace “false” with “yes” in above code.

Delete Old Post Revisions:

If you have previously published articles then they should contain revisions. To free up some disk space and sql database follow these steps:

Caution: Please Backup your database before running any SQL query.

  • Log in to your account on hosting provider and go to phpmyadmin.
  • Now select the database from which you need to delete post revisions.
  • Now go to SQL tab and run this query
    DELETE FROM wp_posts WHERE post_type = "revision";
  • Press Go button to execute this query. Click OK if you prompted for permission to execute query.
  • You will receive confirmation message that your query will executed successfully with the number of rows deleted.

That’s it.

Related Posts with Thumbnails

Leave a Reply

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