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:

1
define('WP_POST_REVISIONS', false);

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

1
2
3
4
5
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.

Tags: , ,

Email This Post Email This Post Print This Post Print This Post

1 Star2 Stars3 Stars4 Stars5 Stars (135 votes, average: 4.04 out of 5)
Loading ... Loading ...

 

150 Responses to “How To Turn Off Post Revision In WordPress 2.6”

  1. Alex says:

    Thanks Lester!

    I found this “feature” quite annoying as well and already posted about it on my own blog only to be notified by one of my friends that you provided solution.

    Thanks a lot!

  2. Lester Chan says:

    You are most welcome =)

  3. SE7EN says:

    Thank you! I have the same problem
    before reading your post, I guess someone’ll create a plugin to cut this feature

  4. oriste says:

    Thank you, thank you, thank you so much. After 2 days of using 2.6 this was already irritating me beyond belief. I knew it would pay off when I subscribed to your RSS feed :-)

  5. Pinyo says:

    Thank you. You’re a life saver…not the little mint candy kind.

  6. [...] if you are having issues with your Organize Series Plugin after the big WordPress upgrade check out Lester Chan’s blog for instructions on how to fix the issue. Series Navigation« Share and Enjoy: These icons [...]

  7. Thank you so much for posting this to share. This new feature was already causing me problems with my Organize Series plugin and it looks like this will fix it!!

  8. Cate says:

    Thanks!!!! I was complaining about this issue earlier today and got pointed over here. I’m not completely fixed but I am content with the steps you provided above as it has taken away the biggest frustrations I have been experiencing.

  9. Lester Chan says:

    Thanks you for the compliments =D

  10. [...] ??? ????????? ?????????? ???????? ??????? ? WordPress 2.6 17 ???? 2008 ? 12:35 ?????: ???? ???????: Wordpress ?????: ???????   ???????? ?????? ?? ??????????: How To Turn Off Post Revision In WordPress 2.6 [...]

  11. [...] ???? ? ?? ???????? ???? ??? ? ?? ???? ???? ?? [...]

  12. [...] conforme Lester Chan, existem algumas providências que podem ser tomadas. A primeira delas, alterar o intervalo de [...]

  13. paresh says:

    nice list.

  14. [...] Tiedot löytyivät WordPressin foorumilta, ja myös kätevästi koottuna Lester Chanin blogimerkinnästä How To Turn Off Post Revision In WordPress 2.6. [...]

  15. It is crazy that Wordpress doesn’t offer this as an option to turn off, I hate to do things directly to the code and database. What happens when you upgrade? At a minimum someone needs to create a plugin.

  16. Awesome! That did the trick! Thank you.

  17. [...] application is limited. This was just a terribly thought out “feature.” Fortunately, it can be disabled and auto save can be set to a reasonable value. Why this isn’t something that can be set in [...]

  18. impNERD says:

    Thanks a lot, this will save a lot of headaches later on. I have no idea why they bothered putting the revisions thing on as default…

  19. Jonathan says:

    Thanks for the post, I’m glad the feature can be turned off.

    As for “why they bothered putting the revisions thing on as default”, this is the biggest problem with Wordpress. A few people (or even just one) controls it, and decides what features will be included, and like it or not, we’re all stuck with it. A similar thing happened when they decided to scrap the database backup feature in favour of an XML export, despite the former being far superior. This is why some very good coders have abandoned Wordpress.

  20. [...] "features" directly through the admin panel. If you want to turn them off, you have to edit the wp-config.php file, which is almost akin to editing the registry in Windows - if you mess something up, you could [...]

  21. Travis says:

    This feature is a bit annoying when I’m trying to browse wp_posts table in phpMyAdmin..
    I wonder if WP delete off old revision after n period of times? :o

  22. Lester Chan says:

    @Jonathan Yea, WP is getting bloated
    @Travis I don’t think it will delete after a certain period

  23. [...] was not there, I was just looking for a way to disable this feature. I stumbled upon this cool solution from Lester [...]

  24. Jan says:

    Thank you! :-)

  25. Patrick says:

    Thanks for the fix. :)

  26. [...] Another Followup: Lester Chan is correct in saying that Post Revisions in Wordpress have very little utility and clutter up the [...]

  27. Emily says:

    Omg life saver. So relieved there is way to stop the revisions, and now i’m scared to go into phpMyadmin lol, because I don’t know what to look for or how to do this. I’ll poke around though, thank you for the solution though :)

  28. noname says:

    I think this is not a feature but a bug and should be so reported. Both features (autosave and revisions) are fine, but the way it is done now is buggy. Autosave feature is at all softwares just ONE autosave of a page, and so it was working with Wordpress. But after adding the revisions function, it started to make this copies. Revisions are fine, but revisions should be only of SAVED document, not autosave. It is also a SECURITY ISSUE - you can e.g. copy to the article the secret data and then you want to delete the secret parts, but with this autosave revisions bug, your secret data are stored in the database and everyone can reach them!

    So
    Yes autosave AND
    Yes revisions
    but no revisions for autosaves!

  29. Ryan Boren says:

    Autosave should create no revisions when saving drafts and one and only one revision when saving published posts. This works fine for me. If you are having problems, help us debug over on this ticket.

 Page 1 of 5  1  2  3  4  5 »

Leave a Reply