deletedAt timestamp, making it possible to restore them later, view them in a dedicated Trash view, or permanently delete them.
Soft delete is a safer way to manage content lifecycle, giving editors a chance to review and recover documents that may have been deleted by mistake.
Collection Configuration
To enable soft deleting for a collection, set thetrash property to true:
Admin Panel behavior
Oncetrash is enabled, the Admin Panel provides a dedicated Trash view for each collection:
- A new route is added at
/collections/:collectionSlug/trash - The
Trashview shows all documents that have adeletedAttimestamp
-
Use bulk actions to manage trashed documents:
- Restore to clear the
deletedAttimestamp and return documents to their original state - Delete to permanently remove selected documents
- Empty Trash to select and permanently delete all trashed documents at once
- Restore to clear the
-
Enter each document’s edit view, just like in the main list view. While in the edit view of a trashed document:
- All fields are in a read-only state
- Standard document actions (e.g., Save, Publish, Restore Version) are hidden and disabled.
- The available actions are Restore and Permanently Delete.
- Access to the API, Versions, and Preview views is preserved.
API Support
Soft deletes are fully supported across all FrogBot APIs: Local, REST, and GraphQL. The following operations respect and support thetrash functionality:
findfindByIDupdateupdateByIDdeletedeleteByIDfindVersionsfindVersionByID
Understanding trash Behavior
Passing trash: true to these operations will include soft-deleted documents in the query results.
To return only soft-deleted documents, you must combine trash: true with a where clause that checks if deletedAt exists.
Examples
Local API
Return all documents including trashed:REST
Return all documents including trashed:GraphQL
Return all documents including trashed:Access Control
All trash-related actions (soft delete, permanent delete, restore) respect thedelete access control defined in your collection config.
This means:
- If a user is denied delete access, they cannot soft delete or permanently delete documents
Differentiating Between Trash and Permanent Delete
You can configure access control to allow some users to trash documents while restricting permanent deletion to admins only. This is useful when you want editors to be able to “delete” content (move to trash) but only allow administrators to permanently remove data. Thedelete access control function receives a data argument that contains the document data being set during the operation:
- When trashing:
data.deletedAtwill be set to a timestamp - When permanently deleting:
datawill beundefined
publish access control works with data._status.
Example: Allow All Users to Trash, Only Admins to Permanently Delete
Example: Only Admins Can Delete (Both Trash and Permanent)
- The delete button will be visible
- The “Delete permanently” checkbox in the confirmation modal will be hidden
- The user can only move documents to trash
Versions and Trash
When a document is soft-deleted:- It can no longer have a version restored until it is first restored from trash
- Attempting to restore a version while the document is in trash will result in an error
- This ensures consistency between the current document state and its version history