All revisions to posts and pages are saved by default. This can lead to unnecessary bloat in the database over time. I suggest adding a simple number box on the Settings → Writing page to allow users to set the number of revisions saved (with zero indicating no revisions are to be kept).
Read-only archive : Issues · ClassicPress/ClassicPress · GitHub
Author : Alan Coggins
Vote count : 20
Status : open
Comments
There is already a constant that can be put in wp-config.php
that achieves this. (I typically use it to allow no revisions to be stored whatsoever.) But I can see this might be worth exposing as a setting within the admin pages. However, the discussion on the forums seems to have turned to making this a per-post setting. That, it seems to me, would very definitely be plugin territory.
~ posted by Tim Kaye
It’s a no from me on this – esp. per-post, which is kinda ridiculous.
One of the things that WordPress has always understood (mostly) is the difference between newbie users and advanced developers.
The vast majority of typical users wouldn’t understand this setting, and might even end up causing themselves problems by configuring it “wrong”. So in the spirit of WordPress usability, I think its better to keep advanced settings hidden from the UI and allow developers or web hosts to configure those in the background.
ClassicPress should avoid being too aggressive in reducing database bloat at the cost of data loss or user confusion. Remember that most of the people offering feedback here are skilled developers, and things are much, much different from the perspective of typical users.
~ posted by Jesse
As originally discussed on another petition , I think this should stay as-is (if you need this advanced feature and you are comfortable with the implications around data loss, then you can edit wp-config.php
to put it in place).
~ posted by James Nylen
This was my petition and agree that it is better done with code as needed. You can close this one @viktor
2 Likes
viktor
August 29, 2021, 11:42pm
3
For anyone looking for a solution, revisions can be limited using a constant inside wp-config.php
:
define( 'WP_POST_REVISIONS', 3 );
This petition will auto close in 14 days to give users time to contest status change.
3 Likes
I’ll definite add this to my wp-config.php. Been using a DB cleaner to remove revisions.
btw, this includes both posts and pages, right?
2 Likes
viktor
August 30, 2021, 3:19am
5
That’s correct. Including custom post types if they support revisions.
Note that this constant (and the example) will only create up to 3 revisions from-then-on . In other words, if you already have a bunch of revisions in the database for a given post, you’re still going to have all those old revisions in the database; just, only 3 new ones would ever be created.
2 Likes
That’s good to now. I’m thinking of adding an Announcement CPT.
2 Likes
viktor
Closed
September 13, 2021, 8:00am
8
This topic was automatically closed after 14 days. New replies are no longer allowed.