Is it possible to remove a large number of published pages in one go? Either in Silverstripe or in PHPadmin. Also, is it possible to remove all the different versions of a page except the live one?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
There are tho two batch actions 'Delete from draft site' and 'Delete from published site'. Check out the 'Batch actions' button, top left of the CMS, and select the pages you want to remove.
There is no batch action to delete a bunch of previous page versions. If you want to remove all previous versions, you can empty the database tables directly: tables with name-extension _versions (like SiteTree_versions) contain previous versions, emptying them won't affect the live pages, but I'd recommend making a backup of the database in advance.
Also there is a SanitizeTask tool here that might help you, but I haven't tried it yet:
https://github.com/silverstripe-labs/silverstripe-recipes/blob/master/model/tools/
Thanks martimiz,
that's exactly what i was looking for!
I didn't have much success with martimiz's suggestion but did find this.
https://github.com/axllent/silverstripe-version-truncator
It is doubly useful as you can limit the number of versions in the database and avoid db bloat.