How To Turn Off Post Revision In WordPress 2.6

One of the irritating feature for me in WordPress 2.6 is the post revision. I am the only author of my blog and hence this feature is useless to me.

Just in case you are wondering how post revision works, whenever a post is edited, a new row will be created in wp_posts table. Hence if your posts or pages got edited 10 times, you will have 10 new rows in wp_posts table.

In no time your wp_posts table will be filled up and the post ID will be huge.

To turn off this feature, add this following code to wp-config.php:

define('WP_POST_REVISIONS', false);

You can also delete all post revisions by running this query in phpMyAdmin:

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'

Be sure to backup your database first before performing any queries in phpMyAdmin.

*UPDATE* Auto Saves does not create a revision of the post.

*UPDATE 2* Updated SQL query from Andrei Neculau as the previous query does not delete from wp_postmeta and wp_term_relationships tables.

150 thoughts on “How To Turn Off Post Revision In WordPress 2.6

  1. Pingback: ?????? Post Revision ?? WordPress 2.6 : XirBIT.Com

  2. Pingback: Desactivar Revisiones en Wordpress 2.6 | Phylosoft

  3. Pingback: WordPress 2.6 - jak wy??czy? system rewizji? | WPNinja

  4. This ‘feature’ has been a terrible nuisance to me as well. Thank you very, very much for this helpful post. It’s brought a much needed smile to my hour of trying to figure out what’s going on.

    Now on to clean out database tables. I’m a bit, actually quite, disappointed with the devs on this one and definitely agree such a feature should be accessible under Settings in admin.

  5. After disabling Post Revisions, I did manage to get one post ID ‘skipped’ so far after about five test posts. Hopefully it’s not autosave causing this. There is still something that may be wrong and hopefully isn’t hastily overlooked (Ryan).

  6. Pingback: Wordpress Revision History : Yuting Zhang’s Homepage

  7. Pingback: Delete Wordpress 2.6 Revisions | Andrei Neculau

  8. Pingback: Abschalten Post Revision in WordPress 2.6 - Beitrag - Heimpold.net

  9. Thanks for fix!!! I cannot believe WP guys came up with this “feature” and did not announce how to fix it…

  10. It appears there is another version of this fix out there.

    Is it this:

    define(‘WP_POST_REVISIONS’, false);

    or this:

    define (‘WP_POST_REVISIONS’, 0);

  11. Pingback: bobpeers -> blog » Turn Off Post Revision In WordPress 2.6

  12. Pingback: Undecided » Blog Archive » Wordpress 2.6 Revisioning & Auto Save features

  13. Thanks for this great post Lester! I installed your Revision Control plugin, and followed your directions for deleting all the revisions in my database. Awesome! I couldn’t believe how many entries were in the database for the revisions. No wonder my post #’s were getting so high. Sheesh. This is sloppy work from WordPress.

  14. Pingback: Organize Series and WordPress 2.6 | Is there food?

  15. Pingback: Weekend Links #2 | OMNINOGGIN

  16. Is this what I need to clean up the old revisions?

    DELETE 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’

  17. @oldengine Yours is more detailed, as mine only cleans up wp_post table and not the term_relationships table and wp_postmeta table.

    Did the code work for you?