Nuke

Two jobs, one idea. A strike deletes a deliberately chosen set of content. A sweep is the recurring housekeeping pass. Neither removes anything you have not been shown first.

The problem it solves

Craft has no bulk delete worth the name. Its element index lets you select a page of results and delete them, which is fine for twenty entries and unworkable for four thousand — so a section gets emptied a hundred at a time, or with a console script nobody reviewed, or with a DELETE typed into a database client.

All three have the same flaw: they tell you nothing. Not how many drafts and revisions travel with the elements, not which surviving entries were pointing at them, not what happens to a structure’s children, and not a word about it afterwards.

The shape of a strike

  1. You name a target: a scope (entries, categories, tags, assets, users), the sources within it, and the filters that narrow it down.
  2. Nuke resolves it to a list of element IDs and counts everything that list implies — drafts, revisions, relations, files, bytes, and the surviving elements that reference it.
  3. You read the blast radius and type the handle of the thing you are deleting to arm the button.
  4. A database backup is taken, named after the run. If it fails, nothing is deleted.
  5. The deletion runs in batches, each its own transaction, through Craft’s own element delete so every other plugin gets to clean up after itself.
  6. The run is recorded — target, preview and outcome — in a ledger and in a log file that outlives the database.

What makes it trustworthy

The preview is not an estimate

The preview and the execution share one code path and one resolved list of IDs. This is the load-bearing decision in the whole plugin: a preview that builds its own query is a preview of a different deletion, and every “it deleted more than it said it would” bug lives in that gap.

The run record stores the preview alongside the outcome, so the run screen can tell you whether the two agreed — and by how much, when they did not.

It knows the things Craft does not tell you

Craft does not delete the children of a structure entry; it moves them up to where their parent was. It cascades relations.sourceId but has no foreign key on targetId at all. A soft delete takes drafts and revisions with it, but leaves them recoverable. None of that is obvious, all of it changes what a bulk deletion means, and the preview says so in words. See what actually goes.

Everything is opt-out, and the defaults hesitate

Soft delete by default. Backup on. Relations kept. History kept. A ceiling of ten thousand elements per run. Users off limits entirely until you say otherwise. An operator who wants it faster has to ask.

The other half

Deleting content is an occasional job. Keeping a site clean is a continuous one, and Craft’s garbage collector — which is good at what it does — does not do most of it. Nuke ships 23 housekeeping tasks across four groups, each with its own retention window, each scanned before it sweeps.

The reason they live in the same plugin: a strike is what creates most of the work a sweep does. Running Craft’s collector at the end of a sweep, rather than waiting for its next probabilistic firing, means one pass clears everything the rest orphaned.

Editions

Lite is free and holds everything above: strikes with the full preview and every guardrail, all 23 sweepers run by hand, the run ledger, the permissions and every console command.

Pro adds scheduled sweeps and emailed reports. Nothing that makes a deletion safe sits behind the paywall — charging for the thing that stops you making a mistake would be a strange way to run a plugin like this.

Requirements

Craft CMS 5.3 or later, PHP 8.2 or later. No runtime dependencies beyond Craft, and one database table for the run ledger.