Connect with us

How to Disable or Limit Post Revision in WordPress


How to Disable or Limit Post Revision in WordPress

WordPress has the post revisions concept which saves your post data at regular intervals. This means if your browser crashes or in any other unexpected circumstance, you might loose your written post. By this Post Revision, WordPress saves your post content after a certain amount of time. So there are many Post Revisions saved in your database, which is useless once your post is published. Also it increases the database load and as a result load time of your page is increased. So here is how to delete post revisions in WordPress:

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’

Above MySQL query will remove all revision post from your database.

But, suppose you don’t want to save Revision Posts than you may disable it by writing a single line of code in wp-config.php file. Also you can limit the Post Revisions in WordPress. So here is how to disable or limit Post Revisions in WordPress. Add below line of code in wp-config.php file which is located in root folder of your WordPress. This will completely disable Post Revision.

// For Disable Post Revision WordPress
define(‘WP_POST_REVISIONS’, ‘false’);
// For Limit Post Revision WordPress
define(‘WP_POST_REVISIONS’, 5);

Related:  New WordPress version released: v4.9.8 - Gutenberg is around the corner!
Continue Reading
You may also like...

We are a WordPress plugin developer company that focuses on useful WordPress plugin creation and empowering people to earn passive incomes from their blogs. We build unique and groundbreaking plugins that will revolutionize your blog!

Click to comment

Leave a Reply

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

More in coding

Sign up for our newsletter and get a free affiliate e-book!

About Me:

Szabi Kisded

Hi, my name is Szabi and I'm documenting my journey earning an online (semi)passive income. Learn more

Mega Plugin Bundle:

CodeCanyon Portfolio:

Online Courses:

Recommended Theme:

Popular Posts:

Latest Posts:

To Top