WordPress plugin intelligence profile

Bauhaus File Cleanup for Tainacan

Removes a Tainacan item's documents, attachments and files from disk on permanent deletion, so deleted items stop leaving orphaned uploads behind.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 7.1
Current version1.1.0
WordPress coverageTested up to WordPress 7.1
Minimum stackWP 5.5 · PHP 8.2
Directory statusactive
Last directory update24 Aug 20262mo ago
Active installationsNewAdoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Bauhaus File Cleanup for Tainacan version 1.1.0 as active, updated 2mo ago and tested up to WordPress 7.1.

Overview

About this plugin

Tainacan does not reliably remove uploaded files from disk when items are permanently deleted. In particular, files of private items — which Tainacan stores in prefixed _x_<item_id> folders — are left orphaned in the uploads directory, slowly bloating disk usage. Tainacan’s own code documents this as an unresolved TODO ( Private_Files::rename_item_and_collection_folder_path returns early on permanent deletion).

This add-on fixes that. While it is active, permanently deleting an item always removes its files by default. You can disable this behaviour from Settings → Bauhaus File Cleanup for Tainacan if you need to temporarily keep files while the plugin stays active.

This is an independent add-on developed by Bauhaus Tech. It is not affiliated with, endorsed by, or part of the Tainacan project.

It works by hooking WordPress’ before_delete_post, which fires on every permanent deletion regardless of where it was triggered:

  • the Tainacan admin trash (REST API);
  • the bulk-edit “delete” background process;
  • the WordPress admin “Empty Trash”;
  • WP-CLI ( wp tainacan... garbage collector);
  • any other wp_delete_post( $id, true ) call.

For each deleted Tainacan item it:

  • Deletes the remaining attachment posts (document, child attachments, thumbnail) forcing real file removal (bypassing the media trash).
  • Removes the item’s dedicated upload folder recursively — covering WordPress-generated derivative image sizes and the private _x_ folders — by reconstructing the path from the item and collection IDs instead of trusting the (often out-of-sync) attachment metadata.

When a whole collection is permanently deleted, its entire tainacan-items/<collection_id> folder is removed too.

Important notes

  • This is destructive and irreversible: files are deleted from disk, not sent to a trash. This is intentional — it is what the plugin exists to do.
  • Each Tainacan item owns an isolated upload folder, so deleting it does not affect other items. The plugin does not scan metadata for attachments shared across items; if you reuse a single attachment across multiple items, deleting one item may remove that shared file.
  • Sending an item to the trash does nothing — cleanup only happens on permanent deletion.
  • This plugin only cleans up files on disk. When a whole collection is permanently deleted, Tainacan does not delete the items that belonged to it — they remain as orphaned rows in the database, and this plugin does not delete them either (it is a file-cleanup tool, not a database tool). Removing those orphaned item/attachment posts is Tainacan’s own responsibility, and Tainacan already ships a tool for it: run wp tainacan garbage-collector --run after deleting a collection to fully clean the database.
WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • disk space
  • attachments
  • cleanup
  • tainacan
  • uploads
Compatibility & maintenance

Compatibility & maintenance

Tested with WP 7.1

Marked as tested with the current WordPress 7.1 release.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to7.1
Minimum requirementsWordPress 5.5 · PHP 8.2
Update activity24 Aug 20262mo ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.