Since WordPress 2.6 post revisions have been included, which means every save of a draft is saved as a revision of that post. This is a great feature for those working in a collaborative environment with multiple editors and is a way of tracking changes, but for those of us who blog alone, it is an unnecessary feature that adds a lot of additional data that will really increase the size of the WordPress database.
There are two ways to turn off this feature so that post revisions are no longer used nor stored in the database. One is a simple change to your wp-config.php file and the other is a plugin.
Code Solution
You will want to add a line to the wp-config.php file This is the imporant file stored with your WordPress installation that contains the name of your database and the username and password to access it. You can access this file via ftp or your cpanel file manager and can edit it in any text editor, like Notepad.
define(‘WP_POST_REVISIONS’, false);
Now, just the one autosave will be saved. I wasn’t too concerned about this until I realized that one post have 20 revisions and that just seemed like way too much to store in my database. Of course, if you turn off this feature, you won’t have access to the silly WordPress Easter Egg.
Plugin Solution
WP-CMS Post Control builds upon WordPress 2.7 features to give total control over the Write Options. One of the things the plugin does is allow you to turn off the Post Revisions. Some of the other features included are turn off auto-save and turn off the flash uploaded so the browser one if the default.
Do you think it’s worth bothering to turn off Post Revisions to keep your database lighter? Or do you utilize and like that feature?
photo credit: jez
stratosg says
Well if you don’t disable it then a lot of clutter fills your database. I wrote about it here a few months back if you recall Kim http://www.stratos.me/2008/11/delete-post-revisions-without-any-plugin/ Anyways in my opinion if you don’t really really use it then disable it. It will save you a lot of space and time when loading posts…
stratosg´s last blog post – Member Of The Month: February
Kim Woodbridge says
Hi Stratos – I don’t remember your article – thanks for including the link to it :-)
The post revisions waste a lot of space – I think they are only needed in
multi-author blogs.
Madhur Kapoor says
I was not aware that it saves each revision . I will remove it immediately.
Madhur Kapoor´s last blog post – Download a Website with WinHTTrack
Kim Woodbridge says
Hi Madhur – Do you think you will edit the config file or use the plugin?
Madhur Kapoor says
Config files seems a simple option
Madhur Kapoor´s last blog post – Download a Website with WinHTTrack
Palma | Buddha Trance says
I have disliked post revisions since day one. Have even tried adding the line of code to the config file a while back, but it didn’t seem to work…. but now I noticed that you don’t have a space between comma and false…. mine did…. I will try yours asap!
Now, this will prevent future post revisions, right? For the old ones, I have to do it from the database, using the command line, as mentioned by stratosg?
Palma | Buddha Trance´s last blog post – Searching for extraterrestrial intelligence at home
Kim Woodbridge says
Hi Palma – I hope it works for you this time. It won’t remove the old ones
and they will need to be removed from the database manually.
Dennis Edell says
Is this a smart thing for a non-techy to do?
Dennis Edell´s last blog post – Best “Blog Improvement Review” Contest – 1 Winner – $100 via Paypal
Kim Woodbridge says
Hi Dennis – If you are not familiar with using a mysql database
then it probably isn’t a good idea to mess with it. Of course, if you
make a backup you always have that if something goes wrong.
stratosg says
Post revisions are extremely useful either if you have multi-author blogs or you write an article over time and want to see what happened when and maybe revert a change that you are not sure about. I keep them on for one more reason. In case something goes wrong during a save, that might destroy my article, they will be there to save me. It’s just a failsafe. One thing you need to do though is clear your revisions every now and then because it clutters your post table a lot!
stratosg´s last blog post – Member Of The Month: February
Palma | Buddha Trance says
Thank you for the advice, really good to know! I will clear the old revisions from the database. I can see the advantages of having them on, as you mention. In my specific case, not only I have a one-author blog, but I write my posts on my local install first, then copy and paste them into the live blog, so there is a failsafe backup locally.
Even with this system, it happens that I go back and edit typos and other stuff, so the revisions pile up.
If the line of code in the config file will not work with my setup, for some reason, I will remember to look at the database regularly!
Palma | Buddha Trance´s last blog post – Searching for extraterrestrial intelligence at home
Kim Woodbridge says
I guess I could add a monthly task to my calendar ;-)
I only write about half my posts in WordPress so I’m not
that worried about losing my work. I hear about that happening
to people but I’ve never had that happen – maybe I’ve just been
lucky.
eberlingeri says
Im starting my WB blog now so this is great advice for me. I think I’ll go and change the code line and see how it goes. Thx Kim!
Kim Woodbridge says
Hi – Great! I’ve popped over to your blog a couple of times. I’m looking
forward to the launch.
Chinese Girl says
This is a really important hack which should be very useful for most bloggers, as I believe majority blogs are run without multi-author participation.
By the way, will this also effects the loading speed of the blog?
Chinese Girl´s last blog post – Changsha Introduction
Kim Woodbridge says
Hi – That’s a good question. Logically you would thing that post
revisions would slow things down. Maybe Stratos will have an opinion
about that.
Raju says
I am someone who would like to have revisions enabled by default. But every month I make it a point to delete the old revisions as explained by Stratos to keep my database clean.
Raju´s last blog post – Top 10 Product Review Websites
Kim Woodbridge says
Hi Raju – I’m a little annoyed with myself for forgetting about his post.
I should have added it to this article. Is Stratos looking over your
shoulder again ;-)
Manshu says
In a future WordPress release, they should have the revisions feature disabled by default and give an option to enable it. Instead of the other way round.
Manshu´s last blog post – Warren Buffet on Clayton Homes
Kim Woodbridge says
Hi Manshu – That’s a really good idea. But I best most people
wouldn’t turn it on and then would complain when they started losing
their work.
Sire says
Well, I reckon I will go for the code revision. I can do with a lot less clutter.
Sire´s last blog post – Chitika The Mark Of A Good Affiliate
Kim Woodbridge says
Hi Sire – Great! Hope it works.
Sire says
How do you know? My blogs are still working, so I suppose that is a good sign.
Sire´s last blog post – In Search Of Fame And Glory
Kim Woodbridge says
LOL – I guess if you still had post revisions for new posts then it
wouldn’t be working. Palma in another comment mentioned she had trouble with the code before.
Sire says
All looks good. I even used Stratos’ tip and cleaned up my database, so even with my pitiful memory, compared to yours, it seems to be running quite smoothly. Thanks for the post Kim :)
Ajith Edassery says
Kim,
This is definitely a great feature that can save a lot of DB space as well because while versioning the code they have to store the delta each time. Unfortunately I can’t use the feature yet as my WP version is a bit outdated :P
Will have to run through several posts of yours once I catch up with the upgrading process.
Cheers,
Ajith
Kim Woodbridge says
Hi Ajith – Stratos has also recommended simply going into the datatbase
and cleaning out the references periodically.
Are you planning on upgrading soon? It seems like it could be a
big project since you have edited some of the core files.
Nihar says
I initially used plugin, then i added that one line code. But, still i see sometimes autosave posts.
Do you know why it still happens.
Nihar´s last blog post – February 2009 Blog Traffic & Income statistics
Kim Woodbridge says
Nihar – I believe you should still get one autosave draft with that code.
Are you getting more than one?
Cath Lawson says
Hi Kim – I’m definitely considering doing this – I make lots of revisions, mostly because I make so many typos. And I usual preview a post before I edit it and change one error at a time – so I wind up with about 20 revisions for each post.
Kim Woodbridge says
Hi Cath – When I write a post in WordPress (I write them in a text
editor half the time) I do the same thing. Change, save, preview – rinse
and repeat. Each post ends up with about 20 revisions, which can’t
possible be good from keeping the database lean.
Jannie Funster says
I really LOVE that post revision feature, so I can go back and consider an earlier draft that is perhaps better than the insufferable schlock I may be about to publish.
Jannie Funster´s last blog post – So there!
Kim Woodbridge says
Hi Jannie – I can’t imagine that you ever write schlock ;-) And I finally
got a comment from someone who wants to keep the revisions…
Carla says
I’m not aware of any clutter in the database – I guess I don’t mess around with it. But the only good thing about the post revisions is when I or my computer screws up and I need to access the last revision just so I can have my post back in one piece.
Carla´s last blog post – California is down to the last drop
Kim Woodbridge says
Hi Carla – It depends on how many revisions you have per post.
Sometimes I have as many as 20 – over time that is going to add a lot
of unnecessary data to the database.
Carla says
@Kim – I have about 20 in a post I’m doing myself. I never knew data in the database (which I really don’t access or even know what it is) would be a problem. I did just try to add the line define(’WP_POST_REVISIONS’, false); into the wp-config.php and it did nothing. I guess I’d better take it as a sign to leave it alone! LOL
Dennis Edell says
Perfect timing, I’ve been looking for this solution. I also finally subscribed to your blog. :)
Dennis Edell´s last blog post – Best “Blog Improvement Review” Contest – 1 Winner – $100 via Paypal
Kim Woodbridge says
Hi Dennis – Great! And it’s about time you subscribed ;-)
Jannie says
Yeah, sometimes in the evening after those 3 big beer lunches have worn off (and often after having to go back to the 99 cent all-day-breakfast place to retrieve my wallet,) I review what I thought was masterful beer-inspired literature to find posts that might need a bit more work.
No, but seriously, I sometimes re-work / tweak my poems and am often glad for the earlier drafts.
Jannie´s last blog post – Seriously Weird!
Kim Woodbridge says
Hi Jannie – LOL – Your lunches are like that too?
I didn’t even think of revisions for poems and stories – that makes
a lot of sense.
Zackatoustra says
Thanks Jannie for the tip.
I’ve noticed that I get as many as 20 or 25 revisions of some of my drafts, which may cause a storage problem some day.
So, I’ll give it a try, since the autosave will still be used (right?), and … I’ve no problem missing the WP easter egg….
Zackatoustra´s last blog post – Brève de Lundi
Kim Woodbridge says
Hi Zackatoustra – Thank you for visiting and commenting.
Yes, the autosave will still work but it will be on the same draft.
Natural says
stumbled this, i hate that feature. i don’t want all those versions saved. i’ll add this to my to-do list for sure.
thanks kim!
Natural´s last blog post – E is for Episode
Kim Woodbridge says
Hi! Great! I don’t like the feature either – I have no need for it.
Harsh Agrawal says
Disabling post revision is good advice, but somehow I feel there is a good reason behind this. I will not advice to disable it..rather limit it to 2-3 post revision.
Harsh Agrawal´s last blog post – How to change your wordpress permalink without loosing traffic
Kim Woodbridge says
Hi – Some people may need a couple of revisions. I’ve never used one though and don’t mind saving over the same one.
denbagus says
how to make draft only in publisher level ?
denbagus´s last blog post – adventure travel tour: Ski Vacations
Kim Woodbridge says
Hi Denbagus – I’m not really sure what you’re asking me …
Yohan Perera says
I definitely want to get rid of post revisions
.-= Yohan Perera´s last blog ..Computer games: Mask of the occult =-.
Kim Woodbridge says
Hi Yohan – They are definitely a waste of database space.
Smith says
You can even edit the wp-config.php file and add a simple line of code which will disable the auto draft being saved.
One method I found is over here http://www.l337fx.com/disable-draftrevisions-wordp
But they state revisions too, and I dont think disabling revisions are worth unless you have large post counts being made.
Sagar says
Thanks for the code solution, will delete and disable it. Occupying a lot of space.
George says
My website was also getting unusually big when I noticed this. I don’t know why wordpress does not allow this by default in the settings.