PHPackages                             lekoala/silverstripe-softdelete - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lekoala/silverstripe-softdelete

ActiveSilverstripe-vendormodule

lekoala/silverstripe-softdelete
===============================

Soft delete extension for SilverStripe

4.0.0(5mo ago)11184.4k↓18.1%8[1 issues](https://github.com/lekoala/silverstripe-softdelete/issues)MITPHPPHP ^8.1

Since Oct 13Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/lekoala/silverstripe-softdelete)[ Packagist](https://packagist.org/packages/lekoala/silverstripe-softdelete)[ GitHub Sponsors](https://github.com/lekoala)[ RSS](/packages/lekoala-silverstripe-softdelete/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (17)Used By (0)

SilverStripe Soft Delete Module
===============================

[](#silverstripe-soft-delete-module)

[![Build Status](https://github.com/lekoala/silverstripe-softdelete/actions/workflows/ci.yml/badge.svg)](https://github.com/lekoala/silverstripe-softdelete/actions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1a1d1d21114e0069cdb862d1ee1c701d8482a396812a24cb9bbe1acc924a825a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c656b6f616c612f73696c7665727374726970652d736f667464656c6574652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/lekoala/silverstripe-softdelete/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/4ce761a01729f1e7b0466efc7cd7d747477aec805088274e144a6d71b0aa80ad/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c656b6f616c612f73696c7665727374726970652d736f667464656c6574652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/lekoala/silverstripe-softdelete/?branch=master)[![Build Status](https://camo.githubusercontent.com/f00f52443d175b159b04cdbe8382a65a6212bb1bc57d1638d8d3fddb785be197/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c656b6f616c612f73696c7665727374726970652d736f667464656c6574652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/lekoala/silverstripe-softdelete/build-status/master)[![codecov.io](https://camo.githubusercontent.com/f0ea3f50e805561272e6ebce042b09b39bb984294afa4320a0927f1e1882ce0b/68747470733a2f2f636f6465636f762e696f2f6769746875622f6c656b6f616c612f73696c7665727374726970652d736f667464656c6574652f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/lekoala/silverstripe-softdelete?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/794c17aeaf5c0035a4d3c85982547e40c7183bb4fb155745fe4e2e483217aaec/68747470733a2f2f706f7365722e707567782e6f72672f6c656b6f616c612f73696c7665727374726970652d736f667464656c6574652f76657273696f6e)](https://packagist.org/packages/lekoala/silverstripe-softdelete)[![Latest Unstable Version](https://camo.githubusercontent.com/91ff84dbfc2af10b7ac8cf90a24127e1b51e109b01e76fa1432f0c2684a7e13d/68747470733a2f2f706f7365722e707567782e6f72672f6c656b6f616c612f73696c7665727374726970652d736f667464656c6574652f762f756e737461626c65)](//packagist.org/packages/lekoala/silverstripe-softdelete)[![Total Downloads](https://camo.githubusercontent.com/197402296e075574e5307bcd6d569be0e411dd82f6bb5ac76310898991ab537a/68747470733a2f2f706f7365722e707567782e6f72672f6c656b6f616c612f73696c7665727374726970652d736f667464656c6574652f646f776e6c6f616473)](https://packagist.org/packages/lekoala/silverstripe-softdelete)[![License](https://camo.githubusercontent.com/007af1ef8e68f6edd728693e8b45dc3b1ae264db1b2bede524b59ae9670cd432/68747470733a2f2f706f7365722e707567782e6f72672f6c656b6f616c612f73696c7665727374726970652d736f667464656c6574652f6c6963656e7365)](https://packagist.org/packages/lekoala/silverstripe-softdelete)[![Monthly Downloads](https://camo.githubusercontent.com/aa018ba255fda06f5c4e030502826524c67d43028bac19f7b58a3d21a9490fbf/68747470733a2f2f706f7365722e707567782e6f72672f6c656b6f616c612f73696c7665727374726970652d736f667464656c6574652f642f6d6f6e74686c79)](https://packagist.org/packages/lekoala/silverstripe-softdelete)[![Daily Downloads](https://camo.githubusercontent.com/4adcc4239f737da10d8ddf030576ef42945121053d7cfa7cc02a7aff7c91afee/68747470733a2f2f706f7365722e707567782e6f72672f6c656b6f616c612f73696c7665727374726970652d736f667464656c6574652f642f6461696c79)](https://packagist.org/packages/lekoala/silverstripe-softdelete)

Add a soft delete behaviour to your dataobjects. Objects are simply marked as deleted and kept in the database.

Soft delete will follow the same permissions patterns as delete.

ModelAdmin and SecurityAdmin are extended to add a new GridField action that replace the default delete action

This module depends on [lekoala/silverstripe-cms-actions](https://github.com/lekoala/silverstripe-cms-actions) for displaying delete buttons

How to use
==========

[](#how-to-use)

Simply replace your calls from delete to softDelete.

New extensions hooks are provided to avoid side effects (onBeforeSoftDelete, onAfterSoftDelete). These are ideals if you have child records that need to be soft deleted with their parent.

Config options
==============

[](#config-options)

```
SilverStripe\Admin\ModelAdmin:
  softdelete_from_list: true
  softdelete_from_list_exclude: []
  extensions:
    - SoftDeleteModelAdmin
SilverStripe\Admin\SecurityAdmin:
  softdelete_from_list: true
  softdelete_from_list_exclude: []
  extensions:
    - SoftDeleteSecurityAdmin
```

You can configure:

- softdelete\_from\_list: show delete button on a line. Enabled by default.
- softdelete\_from\_list\_exclude: hide the delete button for these classes even if enabled globally

Prevent accidental deletion
===========================

[](#prevent-accidental-deletion)

By default, the module will prevent any delete from happening. To allow deletion, you must set

```
SoftDeletable:$prevent_delete = false
```

The only way from the CMS UI to delete a record is to go to a soft deleted record and click "Really delete" which will call "forceDelete" on the record.

Disable filtering
=================

[](#disable-filtering)

You can disable filtering globally, using

```
SoftDeletable::$disable = true
```

Or at query level

```
$dataQuery->setQueryParam('SoftDeletable.filter',false)
```

Filtering on ids
================

[](#filtering-on-ids)

By default, this module will let you return soft deleted records if you ask them specifically by ID. This is by design to prevent things breaking accidentally. If you want to make sure you don't display soft deleted records, make sure to implement a proper canView() method that fits your usage.

An alternative option, is to disable that feature:

```
SoftDeletable:
  check_filters_on_id: false
```

Keep in mind that `DataObject::get_by_id();` can get cached and it can lead to tricky scenarios.

Compatibility
=============

[](#compatibility)

Tested with 6.x

For SilverStripe 5 or Silverstripe 4, please use version 3.x of this module.

Maintainer
==========

[](#maintainer)

LeKoala -

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance77

Regular maintenance activity

Popularity43

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 81.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~228 days

Recently: every ~217 days

Total

16

Last Release

81d ago

Major Versions

1.x-dev → 2.0.02018-07-09

2.x-dev → 3.0.02020-12-14

3.0.7 → 4.0.02025-12-12

3.x-dev → 4.x-dev2026-02-27

PHP version history (5 changes)1.0.0PHP &gt;=5.4.8

2.0.0PHP &gt;=5.6

3.0.0PHP &gt;=7.2

3.0.6PHP ^7.4 || ^8

4.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/250762?v=4)[Thomas Portelange](/maintainers/lekoala)[@lekoala](https://github.com/lekoala)

---

Top Contributors

[![lekoala](https://avatars.githubusercontent.com/u/250762?v=4)](https://github.com/lekoala "lekoala (48 commits)")[![pack254](https://avatars.githubusercontent.com/u/17997208?v=4)](https://github.com/pack254 "pack254 (10 commits)")[![ScottBurfieldMills](https://avatars.githubusercontent.com/u/1740387?v=4)](https://github.com/ScottBurfieldMills "ScottBurfieldMills (1 commits)")

---

Tags

silverstripesoftdeletesilverstripemoduledeletesoft

### Embed Badge

![Health badge](/badges/lekoala-silverstripe-softdelete/health.svg)

```
[![Health](https://phpackages.com/badges/lekoala-silverstripe-softdelete/health.svg)](https://phpackages.com/packages/lekoala-silverstripe-softdelete)
```

###  Alternatives

[lekoala/silverstripe-cms-actions

Add actions to your models in SilverStripe

39279.9k22](/packages/lekoala-silverstripe-cms-actions)[lekoala/silverstripe-mandrill

Adds mandrill in the SilverStripe CMS

1827.3k](/packages/lekoala-silverstripe-mandrill)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
