Enable setting to allow admins to permanently delete data

AI-generated summary

This guide explains how to enable the can permanently delete site setting in Discourse, a feature introduced in version 2026.4.0 that allows administrators to hard-delete topics, posts, and revisions. Because this action is irreversible, the feature includes safeguards such as a 5-minute wait period, requiring a second admin confirmation, and mandatory confirmation text entry.

The setting can be enabled through three methods:

  1. Admin Dashboard: Navigate to Admin > Site Settings > Security and tick the can permanently delete checkbox.
  2. Rails Console: Access the app container via ./launcher enter app, enter the Rails console with rails c, set SiteSetting.can_permanently_delete = true, and exit.
  3. app.yml: Add DISCOURSE_CAN_PERMANENTLY_DELETE: true to the env: section of the configuration file and rebuild the app using ./launcher rebuild app.

In the discussion, Bathinda asks for clarification on the scope of “Delete Data,” wondering if it deletes everything or just a specific container. JammyDodger clarifies that it refers to the hard-delete functionality for individual posts and topics, distinct from soft-deletes. Moin notes that the original post mentions safeguards but omits specific details about the extra steps involved, such as the waiting period and confirmation requirements, suggesting these details should be included for clarity.

:bookmark: This is a guide on how to enable the setting for administrators to permanently delete data on a Discourse instance.

:person_raising_hand: Required user level: Admin

As of v2026.4.0 Changelog | Discourse Releases the site setting to allow admins to permanently delete data is no longer a hidden site setting.

To use this feature, enable the can permanently delete setting. However, please be aware of the risks involved with this feature — as the setting name suggests, if you permanently delete a topic, post, or post revisions, there is no way to restore this content. As such, there are a few safeguards in place:

Enabling permanent deletion via the admin dashboard

To enable the setting using the admin dashboard,

  1. Go to Admin > Site Settings > Security
  2. Search for can permanently delete
  3. Tick the checkbox

Enabling permanent deletion via the Rails console

To enable the setting using the Rails console, execute the following commands:

  1. Access your Discourse application directory:
cd /var/discourse
  1. Enter the app container:
./launcher enter app
  1. Access the Rails console:
rails c
  1. Set the site setting can_permanently_delete to true:
SiteSetting.can_permanently_delete = true
  1. Exit the Rails console:
exit
  1. Exit the app container:
exit

This change takes effect immediately, and no further action is required.

Enabling permanent deletion via app.yml

Another way to enable permanent deletion is through the app.yml configuration file. Follow these steps:

  1. Open the app.yml file located in your Discourse application directory.

  2. Locate the env: section. You can find this under DISCOURSE_HOSTNAME.

  3. Add the following line to enable permanent deletion:

    DISCOURSE_CAN_PERMANENTLY_DELETE: true
    
  4. Save the changes and execute the following command to rebuild your app:

    ./launcher rebuild app
    

Your changes will take effect once the rebuild process is complete.

Last edited by @Moin 2026-05-14T03:04:10Z

Check documentPerform check on document:
20 Likes

“Delete Data” means all the topics, posts, uploads etc, everything will be deleted from our site and it’ll be just an empty new website?


Or it’d delete ‘Data’ container or something?

It refers to this feature - Introducing permanently delete post functionality

It allows admins to hard delete posts/topics when enabled, rather than the normal soft-delete without it.

4 Likes

It feels like something is missing here. Maybe it’s the information about the extra step when enabling the setting or the extra safeguards when deleting a post (5-minute wait or another admin, and the confirmation text you need to enter).

1 Like