PHPackages                             bit-part/craft-asset-trash - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bit-part/craft-asset-trash

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

bit-part/craft-asset-trash
==========================

A Craft CMS plugin that intercepts asset deletion and moves files to a trash directory for later restoration or permanent deletion.

1.0.2(2mo ago)020proprietaryPHPPHP ^8.2

Since Mar 25Pushed 2mo agoCompare

[ Source](https://github.com/bit-part/craft-asset-trash)[ Packagist](https://packagist.org/packages/bit-part/craft-asset-trash)[ RSS](/packages/bit-part-craft-asset-trash/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Asset Trash for Craft CMS 5
===========================

[](#asset-trash-for-craft-cms-5)

English | **[日本語](README-ja.md)** | **[Deutsch](README-de.md)**

A Craft CMS 5 plugin that provides a trash/recycle bin for deleted assets. When an asset is deleted, the file is copied to a `.trash/` directory within the volume, and a database record is kept so it can be restored or permanently deleted later from the control panel.

Requirements
------------

[](#requirements)

- Craft CMS 5.0.0 or later
- PHP 8.2 or later

Installation
------------

[](#installation)

### Via Composer (recommended)

[](#via-composer-recommended)

```
composer require bit-part/craft-asset-trash
```

Then install the plugin from the Craft control panel under **Settings &gt; Plugins**, or via the CLI:

```
php craft plugin/install asset-trash
```

### Manual Installation

[](#manual-installation)

1. Download the release from [GitHub](https://github.com/bit-part/craft-asset-trash)
2. Place the contents in a directory and add a [path repository](https://getcomposer.org/doc/05-repositories.md#path) to your project's `composer.json`
3. Run `composer require bit-part/craft-asset-trash`
4. Install via the control panel or CLI

How It Works
------------

[](#how-it-works)

When you delete an asset in Craft:

1. The plugin intercepts the deletion event
2. The file is **copied** to a `.trash/` directory inside the same volume (e.g., `uploads/.trash/`)
3. A database record is created with metadata (filename, size, volume, path, who deleted it, and element references at the time of deletion)
4. Craft's normal deletion proceeds (the original asset element is removed)

The trashed file remains in `.trash/` until you restore or permanently delete it.

Features
--------

[](#features)

### Trash Listing

[](#trash-listing)

A dedicated **Asset Trash** section appears in the control panel's primary navigation. The listing shows:

- Filename (links to detail view)
- File size
- Who deleted it
- When it was deleted
- Number of element references at the time of deletion

### Volume Filtering

[](#volume-filtering)

If you have multiple volumes, a dropdown filter lets you view trash items from a specific volume or all volumes at once.

### Detail View

[](#detail-view)

Click a filename to see full metadata:

- Filename, kind, and file size
- Volume name and original path (volume base path + filename)
- Title and alt text (if set)
- Deleted-by user and deletion date
- Original asset element ID
- Internal trash path
- A table of element references at the time of deletion (source element ID, type, and field ID)

### Restore

[](#restore)

Restore a trashed item to its original volume and folder. The plugin creates a new asset element and moves the file back from `.trash/` to the original location. If a file with the same name already exists, a unique suffix is added automatically.

### Permanent Delete

[](#permanent-delete)

Remove a trashed item permanently. This deletes the file from `.trash/` and removes the database record. This action cannot be undone.

### Bulk Actions

[](#bulk-actions)

Select multiple items using the checkboxes, then use **Restore Selected** or **Delete Selected** to act on them all at once.

### Empty Trash

[](#empty-trash)

The **Empty Trash** button permanently deletes all items in the trash (or all items in the currently filtered volume). A confirmation dialog is shown before proceeding.

### Auto-Purge

[](#auto-purge)

Expired items can be automatically purged during Craft's garbage collection. Configure the retention period and enable/disable auto-purge in the plugin settings.

Settings
--------

[](#settings)

Navigate to **Settings &gt; Plugins &gt; Asset Trash** to configure:

SettingDefaultDescription**Retention Days**`30`Number of days to keep trashed items before auto-purge. Set to `0` to keep items indefinitely.**Auto Purge**`On`When enabled, expired items are automatically deleted during Craft's garbage collection.**Trash Directory Name**`.trash`The directory name within each volume where trashed files are stored. Must contain only letters, numbers, dots, hyphens, and underscores.Permissions
-----------

[](#permissions)

The plugin registers four permissions under **Asset Trash**:

PermissionDescription**View trash**Access the Asset Trash section in the control panel**Restore assets**Restore trashed items back to their original location**Permanently delete assets**Permanently delete individual trashed items**Empty trash**Use the "Empty Trash" button to delete all items at oncePermissions are nested: the three action permissions require the "View trash" permission to be granted first.

Translations
------------

[](#translations)

The plugin includes translations for:

- English (`en`)
- Japanese (`ja`)

Support
-------

[](#support)

- [GitHub Issues](https://github.com/bit-part/craft-asset-trash/issues)
- [Documentation](https://github.com/bit-part/craft-asset-trash)

License
-------

[](#license)

This plugin is licensed under the [MIT License](LICENSE.md).

---

Built by [bit part LLC](https://bit-part.net)

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance87

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~15 days

Total

3

Last Release

63d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cebdb7172bc7dc536973eac841b10067e87d06196a00dff99542ec039afa6cdd?d=identicon)[bit-part](/maintainers/bit-part)

---

Top Contributors

[![tinybeans](https://avatars.githubusercontent.com/u/181721?v=4)](https://github.com/tinybeans "tinybeans (28 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bit-part-craft-asset-trash/health.svg)

```
[![Health](https://phpackages.com/badges/bit-part-craft-asset-trash/health.svg)](https://phpackages.com/packages/bit-part-craft-asset-trash)
```

###  Alternatives

[spicyweb/craft-neo

A Matrix-like field type with block hierarchy

393808.8k10](/packages/spicyweb-craft-neo)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

292943.4k27](/packages/craftcms-feed-me)[verbb/formie

The most user-friendly forms plugin for Craft.

100387.6k57](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

53675.5k16](/packages/solspace-craft-freeform)[verbb/navigation

Create navigation menus for your site.

92698.4k18](/packages/verbb-navigation)[verbb/workflow

Enforce multi-step review processes for creating entries.

138123.0k1](/packages/verbb-workflow)

PHPackages © 2026

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