This is part of #1388 and #378

WordPress

WordPress has had this feature for ages: https://en.support.wordpress.com/trash

When you delete a post, page, or comment from your blog, it will be moved to the Trash folder. You have separate trash folders for posts, pages and comments. This feature makes it extremely difficult to accidentally delete a post or page from your WordPress.com blog.

wp-move-to-trash-icon

Drupal 8

According to the Trash is a new experimental module change record, this should be already in core since 8.3.0. At the time of writing though, there is no such module listed in a fresh installation of 8.6.2, so I could not test nor provide actual screenshots of the UI.

d.org issue: WI: Phase E: Introduce Trash module

This phase will leverage the new archive and purge API and implement a new experimental module called Trash which gives the ability to "undo" or "restore" the deletion of content entities. See Trash module for current implementation in contrib.

https://www.drupal.org/project/drupal/issues/2797247 is the core issue that is tracking the progress of this, and it is currently against 8.7.x, marked as needs work.

WI: UX prototypes for Trash module is the issue for the UI bit. Here are some screenshots from that issue:

image

image

...and here are some goals defined:

1) Undo - add ability to undo “Move to trash” action

2) Single list of trashed items - currently every entity type has it’s own separate list of trashed items

3) Unifying when to show confirmation page - When deleting content from /admin/content using checkboxes - user is redirected to the confirmation screen “Are you sure you want to delete these items?” When selecting “Delete” option from the “Operations” column on the same page or clicking on “Delete” on the node page itself moves content to trash directly

4) Wording: “Delete” vs “Move to trash” vs “Purge” - “Delete” is used in the tab on node/edit and as an option under the “Operations” column on the /admin/content - “Move to trash” is used in the confirmation message after deleting an item - “Purge” is used in context of removing deleted item from the Trash. My feeling is that “Purge” may sound too technical to general user - Proposal is to use Move to trash” & “Empty trash”

5) Settings page for trash - set if the trash should be automatically emptied after some time - set the number of days after which the trash will be emptied - default content moderation state after moving items to trash - default content moderation stat after restoring items - set if you want to configure this for each entity type ^ if the last is set to yes - all of these settings could be overridden on the content moderation settings page per entity type

Related articles:

Unpublish, don't delete -> Deleting Drupal nodes

Contrib modules

  • Trash module: This contrib project has versions only for D8, D6 and D5 - not sure as to why D7 was skipped. This is what is being ported to D8 core.

    This module adds a trash bin for all content entities.

  • Trash Flag

    Provides trash functionality using flag, views, and node access combined with (a lot) of permissions

  • Killfile / Entity Soft Delete (fork of Killfile):

    Provides soft-deletion/trash bin functionality for Drupal. Content (node/comments/taxonomies/etc) is "soft-deleted" instead of deleted outright, and can be retained for a configurable span of time before being permanently purged. All this is opaque to end-users as all soft-deleted content is pervasively hidden from them, but administrators can access and restore soft-deleted content when necessary. ... Module is fully integrated with Rules, Views , Node UI. The module also records the user whom soft-deleted the content and also deletion time.

    image

    image

GitHub Issue #: 
2498