Like Quertime on Facebook!

How to Disable, Remove and Delete Post Revisions in WordPress

Updated on by in WordPress

WordPress by default creates revisions of your posts automatically. Whenever you save a page or post, the older version is retained so that you can revert it back at any time. However when you publish more posts on your blog, it will make your database slow and ultimately slows down the loading time of your site. Today we would like to show you how to disable and remove post revisions in WordPress.

how_to_disable_remove_and_delete_post_revisions_in_wordPress

How to Disable Post Revisions in WordPress

Open wp-config.php located in your WordPress root directory and add the following code:
define(‘WP_POST_REVISIONS’, false);
You can also disable WordPress’s post revisions function by using Disable Revisions plugin.

How to Manually Remove and Delete Post Revisions in WordPress

how_to_manually_remove_and_delete_post_revisions_in_wordpress

1. Sign in your web hosting account
2. Go to Database section and look for phpMyAdmin
3. After you are redirected to phpMyAdmin interface, select your WordPress database
4. Click on SQL tab
5. Copy and paste the query below and click “Go”

DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_type = 'revision'

6. Now you should be able to see the number of rows that have been deleted from your database

delete_post_revisions_from_wordpress_database

Author:

This post is published by Quertime.com writer / editor. Connect us on Facebook and follow us on X Twitter.

Tags: , , , ,

Comments are closed.