Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Configuration Language Lock 1.0.2 Minor update available for module config_language_lock (1.0.2). Release: Canvas Override 1.0.1 Minor update available for module canvas_override (1.0.1). Release: Media Remote Image 8.x-1.2 Minor update available for module media_entity_remote_image (8.x-1.2). Release: IDNA Convert Service (punycode) 2.0.4 Minor update available for module idna (2.0.4). Release: Bootstrap Cloud 7.1.3 Minor update available for theme bootstrap_cloud (7.1.3). Release: Token Browser 1.0.2 Minor update available for module token_browser (1.0.2). Release: Varbase Project 11.0.8 Minor update available for module varbase_project (11.0.8). Release: Media Remote Image 2.0.0-beta1 First beta version released for module media_entity_remote_image (2.0.0-beta1). Usage Milestone: Term CSV Export Import Module term_csv_export_import crossed 1,000 active installs. Security Coverage: Module Scout Module module_scout now has official Drupal security advisory coverage.

Trash Comment

3 sites No security coverage Drupal 11 · not 10

Part of the Trash ecosystem · 5 projects

View on drupal.org

This module allows comments to be soft-deleted, meaning they are hidden but can be restored, while remaining in their original position in a thread with a placeholder message. This preserves the visual structure and reply chains of comment threads.

About

Deleting a comment in Drupal core is permanent, and it takes every reply below it along with it. That makes moderation risky: removing one bad comment can silently destroy an entire discussion, and there is no way back.

Trash Comment extends the Trash module to comments. A deleted comment is soft-deleted instead of destroyed: it stays in the thread as a neutral placeholder reading "This comment has been deleted", so nested replies remain visible and correctly connected. The original comment can be restored at any time from the Trash overview. This is the behaviour people already know from platforms such as Reddit, YouTube or GitHub.

Features

  • Soft-delete for comments — trashed comments are hidden from regular display but stay in the database and can be restored at any time.
  • Thread-preserving placeholders — deleted comments keep their position in the thread, so nested replies stay visually connected.
  • Trash admin integration — comment types appear in the Trash settings form, so soft-deletion can be enabled per comment type.
  • Access control — trashed comments cannot be edited or deleted through the UI, preventing accidental changes to content that is waiting to be restored.
  • Inspect deleted content — users with the View deleted entities permission see the original comment instead of the placeholder when viewing a page in trash context.
  • No custom database tables — built entirely on the entity API and the Trash module's own hooks.

Requirements

  • Drupal 11.1 or newer — the module uses attribute-based hook discovery, which core added in 11.1.
  • PHP 8.3 or newer
  • Trash 3.0.30 or newer
  • Comment (Drupal core)

Getting started

Install the module with composer require drupal/trash_comment and enable it. Then go to Configuration > Content authoring > Trash (/admin/config/content/trash) and enable the Comment entity type. Optionally restrict soft-deletion to individual comment types; if none are selected, all comment types are covered.

From that point on, deleting a comment moves it to the trash instead of removing it. Trashed comments are listed under Content > Trash (/admin/content/trash), where they can be restored or purged.

Depends on

Dependencies of the latest stable release

  • Trash
  • comment Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Mar 2026
Latest release
2 weeks ago
Releases (12 mo)
4 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.2 Stable 11 Aug 28, 2026
1.0.1 Stable 11 Jun 22, 2026
1.0.0 Stable 10–11 Jun 11, 2026
1.0.0-alpha1 Pre-release 10–11 Mar 10, 2026