Automatically delete old SiteTree page versions from SilverStripe
Failed to load latest commit information.
_config Add docs Feb 6, 2017
docs Add docs Feb 6, 2017
src Typo Feb 6, 2017
.editorconfig Added standard .editorconfig file Dec 20, 2015
.gitattributes Add docs Feb 6, 2017
.scrutinizer.yml Add docs Feb 6, 2017
.upgrade.yml Add docs Feb 6, 2017 Add changelog Feb 6, 2017
LICENSE Create LICENSE Apr 20, 2013 Formatting Feb 6, 2017
composer.json Remove SilverStripe version Mar 9, 2017

Version truncator for SilverStripe

An extension for SilverStripe to automatically delete old SiteTree page versions, keeping the last XX versions per page.

It works for any page extending the SiteTree model, and includes all child models (eg: Page extends SiteTree, so both Page_versions & SiteTree_versions are truncated).


  • Delete all but the last XX published versions of a page (default 10)
  • Delete all but the last XX draft versions of a page (default 5)
  • Optionally keep old versions where the URLSegment has changed to preserve redirects (default true)
  • Delete all redundant versions of a page when switching Page Type (default true)


The module adds two manual tasks to:

  1. Force a run over the entire database
  2. Force a "reset", keeping only the latest published version of each currently published page.


  • SilverStripe 4+


Installation can be done either by composer or by manually downloading a release.

Via composer

composer require "axllent/silverstripe-version-truncator"


Configuration is optional, however you can create a YML file (eg: mysite/_config/version-truncator.yml) and add/edit the following values:

  keep_versions: 10           # how many (published) versions of each page to keep
  keep_drafts: 5              # how many drafts of each page to keep
  keep_redirects: true        # keep page versions that have a different URLSegment (for redirects)
  keep_old_page_types: false  # keep page versions where page type (ClassName) has changed