@siyahbeyaz/strapi-plugin-soft-delete-custom
v1.2.2
Published
Strapi v5 plugin for soft delete functionality
Maintainers
Readme
Strapi Soft Delete Plugin
A professional soft delete plugin for Strapi v5. Safely delete content with the ability to restore, while maintaining data integrity.
Features
- Soft Delete: Delete items without permanently removing them from the database
- Restore Functionality: Easily restore accidentally deleted items via Admin UI
- Strapi v5 Compatible: Fully compatible with Strapi v5.35.0 and higher
- DocumentId Support: Properly handles Strapi v5's documentId system
- Admin UI Explorer: Dedicated page to view and restore soft-deleted items
- TypeScript Support: Full TypeScript definitions included
- Zero Configuration: Works out of the box with sensible defaults
Requirements
- Strapi v5.35.0 or higher
- Node.js 18.0.0 or higher
- npm 6.0.0 or higher
Installation
From npm (recommended)
npm install @siyahbeyaz/strapi-plugin-soft-delete-customThe plugin will automatically configure itself during installation! 🎉
If automatic configuration fails, you can run:
npm run setupOr manually add to your config/plugins.ts:
export default {
'soft-delete': {
enabled: true,
resolve: '@siyahbeyaz/strapi-plugin-soft-delete-custom'
},
};From GitHub
npm install https://github.com/muhammeddeliavci/strapi-plugin-soft-delete-custom/releases/download/v1.2.1/strapi-plugin-soft-delete-custom-1.2.1.tgzRebuild and Restart
npm run build
npm run developThe plugin will be immediately available in your Admin panel under Plugins → Soft Delete.
Usage
Soft Delete
When you delete an item via the Content Manager or API, it's not permanently deleted. Instead:
softDeletedAtfield is set to the current timestampsoftDeletedByIdfield records who deleted itsoftDeletedByTypefield records the user type (admin/api)
The item becomes invisible in normal queries but can be restored.
Restore Deleted Items
- Go to Plugins → Soft Delete in the Admin sidebar
- Select the content type from the dropdown
- Find your deleted item in the list
- Click Restore button
The item will be immediately restored and visible again in normal queries.
Programmatic Usage
// Restore a soft-deleted entity
const restored = await strapi
.plugin('soft-delete')
.service('restore')
.restore('api::article.article', documentId);How It Works
Automatic Field Injection
The plugin automatically adds these fields to all content types:
softDeletedAt(datetime) - When the item was soft deletedsoftDeletedById(string) - ID of the user who deleted itsoftDeletedByType(string) - Type of user (admin/api)
Query Filtering
Soft-deleted items are automatically excluded from:
findandfindManyoperations- Content Manager list views
- API responses
They only appear in the Soft Delete Explorer.
API Endpoints
All endpoints are prefixed with /admin and require authentication.
List Soft Deleted Items
GET /admin/soft-delete/items?modelUid=api::article.articleRestore Item
POST /admin/soft-delete/restore/:uid/:idPermissions
plugin::soft-delete.read- View soft deleted itemsplugin::soft-delete.restore- Restore soft deleted items
Troubleshooting
Plugin not appearing in Admin
- Ensure you've run
npm run build - Check that
enabled: trueis set inconfig/plugins.ts - Restart the Strapi server
Items not showing in Soft Delete Explorer
- Check the browser console for errors
- Ensure the content type has the
softDeletedAtfield - Try refreshing the page
Migration from Strapi v4
If upgrading from v4, you may need to manually add the soft delete fields to your existing content types or run the migration script.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
MIT © 2026
Support
For issues and feature requests, please use the GitHub issue tracker.
Note: This plugin is designed for Strapi v5. For Strapi v4, please use a different version.
