
By Gigasolv
Safely intercept content deletions in Strapi 5 with a soft-delete recycle bin.
released October 27, 2026
npm install strapi-plugin-recycle-binstrapi-plugin-recycle-bin)Safely intercept content deletions in Strapi 5 with a soft-delete recycle bin, one-click document restore, and configurable retention auto-purge policies.
In Strapi 5, when an editor deletes an entry in the Content Manager, it is immediately and permanently purged from the database. Accidental deletions happen often in editorial teams, and until now the only recovery option was restoring a raw database backup.
This plugin provides a safety net:
In your Strapi 5 project root:
# Using npm
npm install strapi-plugin-recycle-bin
# Using yarn
yarn add strapi-plugin-recycle-binEnable and configure the plugin in config/plugins.ts (or config/plugins.js):
export default ({ env }) => ({
'recycle-bin': {
enabled: true,
config: {
retentionDays: 30, // Number of days to keep deleted items before automatic purge
excludedUids: [ // Content types to bypass (not captured into recycle bin)
'admin::user',
'admin::permission',
'admin::role',
'admin::api-token',
'admin::transfer-token',
'plugin::recycle-bin.recycle-bin-item',
'plugin::upload.file',
],
},
},
});strapi.documents(uid).delete(...) is called, the deletion middleware captures the document snapshot, record metadata, and the deleting user context.0 0 * * *) to delete expired items older than retentionDays./recycle-bin/items) require authenticated admin privileges (admin::isAuthenticatedAdmin).MIT © Kaushik Patil
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
