View Full Version : WordPress Post Revisions
sarahG
10-18-2008, 07:32 PM
I'm sure anyone using v2.6+ is aware of the new post revisions in WordPress. Sounds like a great idea, when you make a change to your post, the previous version is kept in case you need to revert back to it.
However, I just noticed that my post IDs were going up more than 1 at a time (typically the IDs would be 1, 2, 3 etc not 1, 5, 8, 12 etc). A quick look in my database shows that the revisions kick in with the auto save feature too. That's fine until you happen to take your time writing a post! A post I wrote yesterday has 7 revisions plus the original. 8 records for a post may not sound much until you work out how many posts you may potentially write per week.
I like the post revision feature, for small CMS based sites, especially where you have clients editing their pages, it's a handy feature. However, on a blog which gets a few to half a dozen posts a week, the potential number of records could grow so quickly.
Anyhow, after all that (yeah I can ramble on ;) ), you can control this quite easily. You can control either the max number of revisions a post has or turn them off completely by adding the following line of code to your wp-config.php file
define('WP_POST_REVISIONS', 0);
Where the 0 is the max number of revisions you want to allow (0 means no revisions are saved ie. you've switched the post revisions off). I don't know whether allowing say 1 revision will mean that the two versions kept will be the two most recent, or whether it'll be the first version and the last (and nothing in between will be kept). Hopefully the WP developers will work on this a bit more for 2.7.
Anyway, hope that's of use to some. It was something that took me by surprise this evening as I didn't realise that revisions were made by the auto save feature, I thought they were just made after you've physically saved or published the post.
Rarst
10-18-2008, 10:48 PM
I've disabled them right from the start. I just don't like to go back and forth between different versions of anything, it's confusing and time-wasting.
navjotjsingh
10-19-2008, 03:04 PM
Strange but Ryan Boren(one of Wordpress developer) has certified that autosave does not create a revision unless a post is in draft and creates a single revision only after the post is published.
Check here: http://lesterchan.net/wordpress/2008/07/17/how-to-turn-off-post-revision-in-wordpress-26/#comment-20921
Also check this ticket in response to this problem which was closed later on: http://trac.wordpress.org/ticket/7379
Strange but Ryan Boren(one of Wordpress developer) has certified that autosave does not create a revision unless a post is in draft and creates a single revision only after the post is published.
What the issue is is that it can create several revisions while the post is in draft and you "save as you go". Instead of deleting the previous revision(s) they get kept in the database. Following your save that version is counted as the new revision and autosaves update that. Previous revisions are not removed, so they build up and can quickly add weight to your database. They need to address the issue because saving as you go is automatic for a lot of people, and this needs to be considered along with the autosaves.
navjotjsingh
10-19-2008, 03:25 PM
What the issue is is that it can create several revisions while the post is in draft and you "save as you go". Instead of deleting the previous revision(s) they get kept in the database. Following your save that version is counted as the new revision and autosaves update that. Previous revisions are not removed, so they build up and can quickly add weight to your database. They need to address the issue because saving as you go is automatic for a lot of people, and this needs to be considered along with the autosaves.
Maybe you didn't read the ticket text of Ryan...Here is a quote:
For draft posts, autosave always overwrites the draft post itself. It does not create new revisions. Explicitly saving a draft will create a revision, as intended. After the explicit save, autosave continues to overwrite the draft. It does not create revisions. When editing a published post, autosave creates one autosave revision. Autosave always uses this one revision to store autosaves. Explicitly saving the post creates a revision, as intended. After explicit saves, autosave continues to use the designated autosave revision.
So, for drafts, autosave does not create revisions. For published posts, autosave creates one revision and overwrites it for each autosave. A published post will have at most one autosave revision.
If autosaves are creating multiple revisions for you, you have a bug I cannot reproduce. More details are needed. Please note that explicit clicks of the Save and Publish buttons are not autosaves and should indeed create revisions.
Maybe you didn't read the ticket text of Ryan...Here is a quote:
I read the ticket. As I said, the issue is with saving as you go, not autosaves. If you hit save then a new revision is created. If you hit save again another is created but the previous one is not removed. If you hit save again you now have 3 revisions, and so on.
Try it, it really does happen.
What they need to do is address that issue so that when a user saves it is dealt with in the same way as an autosave. If they want autosaving instead of users saving then they need to remove the option for the user to manually save their post.
navjotjsingh
10-19-2008, 03:48 PM
I read the ticket. As I said, the issue is with saving as you go, not autosaves. If you hit save then a new revision is created. If you hit save again another is created but the previous one is not removed. If you hit save again you now have 3 revisions, and so on.
I know this happens. Thanks for being more clear. But if it does not create a revision, then there is no use of this feature. So what you want is complete removal of Post Revision?
What they need to do is address that issue so that when a user saves it is dealt with in the same way as an autosave. If they want autosaving instead of users saving then they need to remove the option for the user to manually save their post.If you want this to be implemented, then yes save button would be of no use. You need to understand Post Revision and AutoSave is completely different.
I only clarified that AutoSave does not create post revision and you maybe didn't understood me. I never said, manual save does not create post revision.
What wordpress should do is offer the following options within Admin panel
Option to disable AutoSave, Post Revision or both
Option to control time between each AutoSave
Option to control number of Post Revisions
sarahG
10-19-2008, 03:57 PM
No you're right, the autosave isn't causing the revisions, but something weird is going on and it's not from hitting save all the time. here's a screen shot of one of my posts, and I don't hit save that often!
http://www.stuffbysarah.net/images/post-rev.gif
However, as you say, WordPress does need to give more control over these revisions. The ability to remove them for a start would be good*. I know I could go into the database and remove them but I shouldn't have to :)
* I'm sure there's a plugin or will be a plugin for this at some point soon.
Revisions are a good idea, providing people are given the ability to control what's happening on their site.
Edit: Just to add, I think, even if you don't save any revisions of your post you'll still end up with at least 2 records per post.
I know this happens. Thanks for being more clear. But if it does not create a revision, then there is no use of this feature. So what you want is complete removal of Post Revision?
No, not removal of the feature. just having it fixed.
There is no value in a feature that continually saves new versions of a post without clearing up after itself. If I was to make a post a day and saved as I go I could end up with several thousand database entries a year with only 365 being needed.
If you want this to be implemented, then yes save button would be of no use.
It's only of no use if the only way to not have a build up of junk entries in your database is to not manually save.
You need to understand Post Revision and AutoSave is completely different.
Yes, I do understand that they are different.
I only clarified that AutoSave does not create post revision and you maybe didn't understood me. I never said, manual save does not create post revision.
And I'm clarifying that saving does create a revision with every save, which is an issue and in keeping with the topic being discussed.
What wordpress should do is offer the following options within Admin panel
Option to disable AutoSave, Post Revision or both
Option to control time between each AutoSave
Option to control number of Post Revisions
Plus the option to delete revisions, both individually and en masse. There's no point in having a number of revisions clog up a database when the desired post has already been published.
navjotjsingh
10-19-2008, 04:19 PM
* I'm sure there's a plugin or will be a plugin for this at some point soon.
Edit: Just to add, I think, even if you don't save any revisions of your post you'll still end up with at least 2 records per post.
There is a plugin which can control revisions per post basis and even globally: http://wordpress.org/extend/plugins/revision-control/
Also this plugin allows you to delete specific revisions. But I could not find any plugin which deletes every revision in a single go.
And yes, I have noticed that too. Most of my posts do contain atleast 2 revisions. Need to be careful while publishing next post and will check when that revision gets created.
Just to add, the method define('WP_POST_REVISIONS', false); method described here (http://lesterchan.net/wordpress/2008/07/17/how-to-turn-off-post-revision-in-wordpress-26/#comment-20921) doesn't appear to work for me. I added that yesterday however today when testing before making the post above I still got 6 revisions saved.
There is a plugin which can control revisions per post basis and even globally: http://wordpress.org/extend/plugins/revision-control/
Also this plugin allows you to delete specific revisions. But I could not find any plugin which deletes every revision in a single go.
That's a good find. If it works as intended hopefully they'll implement its features in the next release of WP.
navjotjsingh
10-19-2008, 04:26 PM
That's a good find. If it works as intended hopefully they'll implement its features in the next release of WP.
Not possible in near future. I have checked wordpress trac for any development related to this and mostly developers don't want to so called clutter wordpress admin or posts page to disable revisions. (sorry lost the particular link)....So in near future it won't seem probable that this feature would be added.
sarahG
10-19-2008, 04:33 PM
Here's a good blog post on the subject - http://www.optiniche.com/blog/422/autosave-post-revision-control/
And I've grabbed the Revision control plugin linked above too, as it seems that the define code posted in the first post doesn't actually seem to work. Which is strange as everyone is saying it does/should. Only reason I can guess is because I'm on 2.6.1 and not .2 however these posts and fixes were written before .2 came out.
Not possible in near future. I have checked wordpress trac for any development related to this and mostly developers don't want to so called clutter wordpress admin or posts page to disable revisions. (sorry lost the particular link)....So in near future it won't seem probable that this feature would be added.
Well I think they're making a mistake with that, all it would take would be a single admin page accessed via the settings menu. This kind of buggy behaviour can be enough to make people consider alternative software, heavy posters who don't know about the issue could well find it costing them money as they run out of web space several times faster than they would otherwise have done. However at least there's a plugin that can help us. I've only done a brief test and it appears to do what's required, but I'll need to test it thoroughly and check my database to make sure before I'm certain.
as it seems that the define code posted in the first post doesn't actually seem to work. Which is strange as everyone is saying it does/should. Only reason I can guess is because I'm on 2.6.1 and not .2 however these posts and fixes were written before .2 came out.
I'm on 2.6.2 and it doesn't work for me either.
* I'm sure there's a plugin or will be a plugin for this at some point soon.
better get cracking then sarah ;)
sarahG
10-23-2008, 10:56 AM
There's already one, posted on page one ;)
victor2008
11-06-2008, 06:54 AM
One of the hot new features of 2.6 is post or page revision management. This is a splendid feature for multi-author blogs because it allows you to see what was changed in a post, by whom and when. Unfortunately, this is a bit overboard for single author bloggers who truly don’t need to keep a running tally of every single revision. Since WordPress developers didn’t disable this feature by default or provide a distinct option under Settings, it will require a bit of file editing or installation of a plugin to properly manage.
=================================
Victor
Social Bookmarking (http://www.widecircles.com)
One of the hot new features of 2.6 is post or page revision management. This is a splendid feature for multi-author blogs because it allows you to see what was changed in a post, by whom and when.
Yeah, I agree with you. It's a great feature for that. I'm part way through porting an old site from Nucleus to Wordpress and a part of the process is fixing badly structured posts and it's handy to be able to see which revision belongs to me and which to the person who originally wrote it.
Indyan
11-06-2008, 11:46 AM
I also disabled it. Its of no use as far as I am concerned and just increases the bulk of my db.
vBulletin® v3.8.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.