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 (111 votes, average: 3.92 out of 5)
Loading ... Loading ...

 

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

  1. Alex's Avatar
    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!

    Alex did not rate this post.
  2. Lester Chan's Avatar
    Lester Chan Says:

    You are most welcome =)

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  3. SE7EN's Avatar
    SE7EN Says:

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

    SE7EN ratings for this post: SE7EN gives a rating of 5SE7EN gives a rating of 5SE7EN gives a rating of 5SE7EN gives a rating of 5SE7EN gives a rating of 5
  4. oriste's Avatar
    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 :-)

    oriste ratings for this post: oriste gives a rating of 5oriste gives a rating of 5oriste gives a rating of 5oriste gives a rating of 5oriste gives a rating of 5
  5. Pinyo's Avatar
    Pinyo Says:

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

    Pinyo did not rate this post.
  6. An Update to my Organize Series Plugin Post | The Blonde Diaries's Avatar
    An Update to my Organize Series Plugin Post | The Blonde Diaries Says:

    [...] 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. Kimberly @ All About Kimberly's Avatar
    Kimberly @ All About Kimberly Says:

    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!!

    Kimberly @ All About Kimberly did not rate this post.
  8. Cate's Avatar
    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.

    Cate ratings for this post: Cate gives a rating of 5Cate gives a rating of 5Cate gives a rating of 5Cate gives a rating of 5Cate gives a rating of 5
  9. Lester Chan's Avatar
    Lester Chan Says:

    Thanks you for the compliments =D

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  10. Disabilitare le revisioni dei post in WordPress 2.6 » Ubuntu block notes's Avatar
  11. ??? ????????? ?????????? ???????? ??????? ? WordPress 2.6 | Mistress of the site's Avatar
    ??? ????????? ?????????? ???????? ??????? ? WordPress 2.6 | Mistress of the site Says:

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

  12. WordPress 2.6 Post Revisions @ Blog.Caspie.Net's Avatar
    WordPress 2.6 Post Revisions @ Blog.Caspie.Net Says:

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

  13. Novo Wordpress 2.6: Problemas e soluções – The Back-up Brain Weblog's Avatar
    Novo Wordpress 2.6: Problemas e soluções – The Back-up Brain Weblog Says:

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

  14. paresh's Avatar
    paresh Says:

    nice list.

    paresh did not rate this post.
  15. MS-potilas » Arkisto » WordPress 2.6: Revisioiden tallennus pois päältä's Avatar
    MS-potilas » Arkisto » WordPress 2.6: Revisioiden tallennus pois päältä Says:

    [...] 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. [...]

  16. Peter Answers's Avatar
    Peter Answers Says:

    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.

    Peter Answers did not rate this post.
  17. Ron@TheWisdomJournal's Avatar
    Ron@TheWisdomJournal Says:

    Awesome! That did the trick! Thank you.

    Ron@TheWisdomJournal did not rate this post.
  18. Epic Banality » Blog Archive » Technical Adventures in OCD and Other Rants's Avatar
    Epic Banality » Blog Archive » Technical Adventures in OCD and Other Rants Says:

    [...] 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 [...]

  19. impNERD's Avatar
    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…

    impNERD did not rate this post.
  20. Jonathan's Avatar
    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.

    Jonathan did not rate this post.
  21. Where did WordPress go wrong? | Sephy's Platzish's Avatar
    Where did WordPress go wrong? | Sephy's Platzish Says:

    [...] "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 [...]

  22. Travis's Avatar
    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

    Travis ratings for this post: Travis gives a rating of 5Travis gives a rating of 5Travis gives a rating of 5Travis gives a rating of 5Travis gives a rating of 5
  23. Lester Chan's Avatar
    Lester Chan Says:

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

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  24. Disable/Turn off post revisions and increase post autosave interval in wordpress 2.6 | Wordpress & Plugins's Avatar
    Disable/Turn off post revisions and increase post autosave interval in wordpress 2.6 | Wordpress & Plugins Says:

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

  25. Jan's Avatar
    Jan Says:

    Thank you! :-)

    Jan ratings for this post: Jan gives a rating of 5Jan gives a rating of 5Jan gives a rating of 5Jan gives a rating of 5Jan gives a rating of 5
  26. Patrick's Avatar
    Patrick Says:

    Thanks for the fix. :)

    Patrick ratings for this post: Patrick gives a rating of 5Patrick gives a rating of 5Patrick gives a rating of 5Patrick gives a rating of 5Patrick gives a rating of 5
  27. Lee.org » Installed Wordpress 2.6, Problems's Avatar
    Lee.org » Installed Wordpress 2.6, Problems Says:

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

  28. Emily's Avatar
    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 :)

    Emily ratings for this post: Emily gives a rating of 5Emily gives a rating of 5Emily gives a rating of 5Emily gives a rating of 5Emily gives a rating of 5
  29. noname's Avatar
    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!

    noname did not rate this post.
  30. Ryan Boren's Avatar
    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.

    Ryan Boren did not rate this post.
  31. ?????? Post Revision ?? WordPress 2.6 : XirBIT.Com's Avatar
    ?????? Post Revision ?? WordPress 2.6 : XirBIT.Com Says:

    [...] ??????? : How To Turn Off Post Revision In WordPress 2.6 [...]

  32. Desactivar Revisiones en Wordpress 2.6 | Phylosoft's Avatar
    Desactivar Revisiones en Wordpress 2.6 | Phylosoft Says:

    [...] La solución completa la encontré en: How To Turn Off Post Revision In WordPress 2.6 [...]

  33. Lester Chan's Avatar
    Lester Chan Says:

    @Ryan Boren, @noname : Yea I confirm that auto save does not create a revision. My bad.

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  34. DD32's Avatar
    DD32 Says:

    Just a heads up: I wrote a plugin which allows some control over the post revisions (Disabling in admin, Enabling on per post basis, limiting number of revisions, etc): http://dd32.id.au/wordpress-plugins/revision-control/

    PS. @validation function: ‘ ‘ is a valid character in an email address

    DD32 did not rate this post.
  35. DD32's Avatar
    DD32 Says:

    Oh.. It doesnt like the plus symbol at alll.. Lovely :)

    DD32 did not rate this post.
  36. Lester Chan's Avatar
    Lester Chan Says:

    @DD32: Nice! WordPress should have that in the core.

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  37. WordPress 2.6 - jak wy??czy? system rewizji? | WPNinja's Avatar
    WordPress 2.6 - jak wy??czy? system rewizji? | WPNinja Says:

    [...] Rozwi?zania doszuka?em si? na blogu Lestera. Trzeba przyzna?, ?e jest ono balane i nie wymaga zbyt du?ej znajomo?ci programistycznej. [...]

  38. Wakefield's Avatar
    Wakefield Says:

    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.

    Wakefield ratings for this post: Wakefield gives a rating of 5Wakefield gives a rating of 5Wakefield gives a rating of 5Wakefield gives a rating of 5Wakefield gives a rating of 5
  39. Wakefield's Avatar
    Wakefield Says:

    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).

    Wakefield ratings for this post: Wakefield gives a rating of 5Wakefield gives a rating of 5Wakefield gives a rating of 5Wakefield gives a rating of 5Wakefield gives a rating of 5
  40. Wordpress Revision History : Yuting Zhang’s Homepage's Avatar
  41. Robert's Avatar
    Robert Says:

    Don’t put it at the end of wp-config.php or it won’t work.

    Robert ratings for this post: Robert gives a rating of 4Robert gives a rating of 4Robert gives a rating of 4Robert gives a rating of 4Robert gives a rating of 4
  42. Rachel's Avatar
    Rachel Says:

    Can’t believe this bloody thing is a feature! Thanks for the help

    Rachel did not rate this post.
  43. oldengine's Avatar
    oldengine Says:

    This must be a sore spot at Wordpress software central.

    Comment from support: “First question: Why do you think that it matters how many posts/pages/revisions/whatever are in the database? Databases are fast and efficient, and text compresses easily, you know.”

    http://wordpress.org/support/topic/191420?replies=1#post-812141

    oldengine ratings for this post: oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5
  44. Delete Wordpress 2.6 Revisions | Andrei Neculau's Avatar
    Delete Wordpress 2.6 Revisions | Andrei Neculau Says:

    [...] what about those revisions left in your database? Several posts look as if they found the true answer, but it’s one of those “The one who laughs [...]

  45. Abschalten Post Revision in WordPress 2.6 - Beitrag - Heimpold.net's Avatar
  46. Max's Avatar
    Max Says:

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

    Max ratings for this post: Max gives a rating of 5Max gives a rating of 5Max gives a rating of 5Max gives a rating of 5Max gives a rating of 5
  47. oldengine's Avatar
    oldengine Says:

    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);

    oldengine ratings for this post: oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5
  48. bobpeers -> blog » Turn Off Post Revision In WordPress 2.6's Avatar
    bobpeers -> blog » Turn Off Post Revision In WordPress 2.6 Says:

    [...] title says it all. This page describes how to do it and to stop the wp_posts table filling up with multiple copies of the same [...]

  49. Lester Chan's Avatar
    Lester Chan Says:

    @oldengine: Both is the same thing as false is equals to 0 as well.

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  50. drk's Avatar
    drk Says:

    thank you,
    this was helpful! :)

    drk did not rate this post.
  51. Nate's Avatar
    Nate Says:

    Where do I put the snippet of code in the wp-config.php file??

    Nate did not rate this post.
  52. Undecided » Blog Archive » Wordpress 2.6 Revisioning & Auto Save features's Avatar
    Undecided » Blog Archive » Wordpress 2.6 Revisioning & Auto Save features Says:

    [...] to Lester Chan for highlighting the config settings for turning off revisioning and for modifying the autosave [...]

  53. Lester Chan's Avatar
    Lester Chan Says:

    After define('DB_COLLATE', ''); should be fine.

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  54. Brian's Avatar
    Brian Says:

    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.

    Brian ratings for this post: Brian gives a rating of 5Brian gives a rating of 5Brian gives a rating of 5Brian gives a rating of 5Brian gives a rating of 5
  55. Lester Chan's Avatar
    Lester Chan Says:

    Hi Brian, thanks for the compliments. I think the Revision Control plugin is from dd32 and is inspired by this post =D

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  56. Organize Series and WordPress 2.6 | Is there food?'s Avatar
    Organize Series and WordPress 2.6 | Is there food? Says:

    [...] off, follow the mighty Lester Chan’s advice to turn off post revisions. You can also use the SQL he’s posted to delete revisions [...]

  57. Weekend Links #2 | OMNINOGGIN's Avatar
    Weekend Links #2 | OMNINOGGIN Says:

    [...] How To Turn Off Post Revision In WordPress 2.6: Lester Chan shows you how to turn of Post Revision in WordPress 2.6. In my opinion, the best new feature in WordPress 2.6 is Post Revision support. That said, some people do not like it because it creates full copies of your post on every save, thus leaving unneeded garbage behind. [...]

  58. oldengine's Avatar
    oldengine Says:

    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’

    oldengine ratings for this post: oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5
  59. Lester Chan's Avatar
    Lester Chan Says:

    @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?

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  60. oldengine's Avatar
    oldengine Says:

    It came from here:
    http://andreineculau.com/blog/2008/07/delete-wordpress-26-revisions/

    I was just looking to see if this was a recommended procedure. (My database is a mess of revisions and it needs a complete cleaning.)

    oldengine ratings for this post: oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5oldengine gives a rating of 5
  61. Lester Chan's Avatar
    Lester Chan Says:

    @oldengine Thanks, I have updated the code.

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  62. Andrei Neculau's Avatar
    Andrei Neculau Says:

    One small correction I’ve made just now –
    DELETE a,b,c

    Andrei Neculau did not rate this post.
  63. Lester Chan's Avatar
    Lester Chan Says:

    Thanks updated =D

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  64. zer0day's Avatar
    zer0day Says:

    :o Didn’t realize it was on by default, thanks for post.

    zer0day ratings for this post: zer0day gives a rating of 5zer0day gives a rating of 5zer0day gives a rating of 5zer0day gives a rating of 5zer0day gives a rating of 5
  65. How To Remove WordPress Post/Page Revisions | WordPress Geeks's Avatar
    How To Remove WordPress Post/Page Revisions | WordPress Geeks Says:

    [...] finally, Lester Chan offers a way to delete the revisions that have already been [...]

  66. Jonnya's Avatar
  67. Mix's Avatar
    Mix Says:

    I just did it, and removed about 80 additional posts I won’t need.

    Thanks for the very clean fix!

    Mix did not rate this post.
  68. Scott’s Corner » Blog Archive » Random gaming update's Avatar
    Scott’s Corner » Blog Archive » Random gaming update Says:

    [...] points to good advice from Lester Chan to ensure that you don’t fill up your wordpress revision [...]

  69. StevyGee's Avatar
    StevyGee Says:

    Thanks a lot, this solved a blank page error when trying to edit a post I made after the upgrade. All the other articles

    StevyGee did not rate this post.
  70. Jo Bench's Avatar
    Jo Bench Says:

    Same for me, thanks a lot, also it solved the blank page error when trying to edit a post and I don’t think it is very useful to have a revision of each post.
    Also my provider only gives me 100Mb of mysql space and I think with a open public blog it will rapidly got out of space.

    Thanks and bye

    Jo Bench did not rate this post.
  71. Desabilitar a opção Post Revision no WordPress 2.6's Avatar
    Desabilitar a opção Post Revision no WordPress 2.6 Says:

    [...] que vi em dois sites (primeiro e segundo) pode-se facilmente desabilitar a revisão de posts adicionando a linha abaixo no arquivo [...]

  72. Las revisiones en Wordpress 2.6 | Desde El Arroyo's Avatar
    Las revisiones en Wordpress 2.6 | Desde El Arroyo Says:

    [...] información la he sacado fundamentalmente de esta web y juraría que también se habló de ello en Ayuda Wordpress, pero me ha sido imposible encontrar [...]

  73. Hirvine's Avatar
    Hirvine Says:

    Thanks was looking for the option. Just wanting to mention the post is highly appreciated.

    Hirvine did not rate this post.
  74. On WordPress Bugs, Not Features : Allyn Gibson's Avatar
    On WordPress Bugs, Not Features : Allyn Gibson Says:

    [...] WordPress guru Lester Chan found a way. An edit to the wp-config file turns off post [...]

  75. How To Remove WordPress Post Revisions's Avatar
    How To Remove WordPress Post Revisions Says:

    [...] a database full of revisions, you can get rid of them. Lester Chan outlines a nice and easy way to remove the old revisions from your [...]

  76. Daniel Richard's Avatar
    Daniel Richard Says:

    Phew! You just saved my day with this hack.

    Daniel Richard ratings for this post: Daniel Richard gives a rating of 5Daniel Richard gives a rating of 5Daniel Richard gives a rating of 5Daniel Richard gives a rating of 5Daniel Richard gives a rating of 5
  77. just browsing's Avatar
    just browsing Says:

    Awesome! I have been deleting the “iframe - malware” stuff and each time I deleted a visible iframe, I was auto-saving/revisions the hidden iframe. Your just helped me “clean” my site, Thanks! Now Google will release me.

    just browsing did not rate this post.
  78. WordPress and how to disable post revisions - Forty Plus Two's Avatar
    WordPress and how to disable post revisions - Forty Plus Two Says:

    [...] How To Turn Off Post Revision In WordPress 2.6 is the answer to how to disable. To turn it off, add the following code to [...]

  79. Robert@PNG's Avatar
    Robert@PNG Says:

    Hi Lester,

    Those of us that ran the original “Delete” as recommended by Andrei Neculau would now have orphaned records in the term_relationships and postmeta tables.

    Any suggestions?

    R

    Robert@PNG ratings for this post: Robert@PNG gives a rating of 5Robert@PNG gives a rating of 5Robert@PNG gives a rating of 5Robert@PNG gives a rating of 5Robert@PNG gives a rating of 5
  80. hamdan's Avatar
    hamdan Says:

    Thank you for this info. Post revisions consume a lot of my database space, so I have to turn it off otherwise I’ll run out of my hosting space.

    hamdan did not rate this post.
  81. Lester Chan's Avatar
    Lester Chan Says:

    Hi Robert,

    No idea whether this code works, you want to try to see if it returns any results first.

    SELECT 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.id IS NULL

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5
  82. Robert@PNG's Avatar
    Robert@PNG Says:

    Hi Lester,

    Thanks for responding so quickly.

    I ran the code you noted above and got the following response:

    #1054 - Unknown column ‘a’ in ‘field list’

    Just as an aside and an added benefit to turning of post revisioning and also the automatically saving of posts is the CPU savings. Since turning off both - I am no longer getting penalised by my Hosting Provider for chewing up CPU cycles. A big plus!!

    Cheers,

    R

    NB: I have been using your WP-DBManager and WP-PluginsUsed and they are tops!!

    Robert@PNG ratings for this post: Robert@PNG gives a rating of 5Robert@PNG gives a rating of 5Robert@PNG gives a rating of 5Robert@PNG gives a rating of 5Robert@PNG gives a rating of 5
  83. Lester Chan's Avatar
    Lester Chan Says:

    Ops my bad, try this code:
    DELETE b, c
    FROM wp_term_relationships b LEFT JOIN wp_postmeta c ON (c.post_id = b.object_id) WHERE post_id IS NULL

    I tested it, it should work

    Lester Chan ratings for this post: Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5Lester Chan gives a rating of 5