Keep last 5 versions

I would like to keep last “n” versions of a document. Is there any setting to do this? Kindly point me to the right documentation.

  • Dominic

There is nothing like this out of the box no. It would not be very hard to implement a listener which clean old versions when a document is saved.

Hi, AFAIK this is not a feature that exists and it’s not been developed on purpose so that no data is lost. Now, there are DB tables holding revision data and you could remove some rows in these tables but you’d need to be very careful and understand the DB schema well. Another safer option is to use XWiki APIs to delete revisions (slower but safer) by writing some scripts. Some example here: