This is a guide on how to enable the setting for administrators to permanently delete data on a Discourse instance.
Required user level: System Admin
Console access required
As of 2.8.0.beta7: Security Release, Fast Edits, Topic Bookmarks, and more there is a site setting to allow admins to permanently delete data.
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,
- Go to
Admin > Site Settings > Security - Search for
can permanently delete - Tick the checkbox
Enabling permanent deletion via the Rails console
To enable the setting using the Rails console, execute the following commands:
- Access your Discourse application directory:
cd /var/discourse
- Enter the app container:
./launcher enter app
- Access the Rails console:
rails c
- Set the site setting
can_permanently_deletetotrue:
SiteSetting.can_permanently_delete = true
- Exit the Rails console:
exit
- 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:
-
Open the
app.ymlfile located in your Discourse application directory. -
Locate the
env:section. You can find this underDISCOURSE_HOSTNAME. -
Add the following line to enable permanent deletion:
DISCOURSE_CAN_PERMANENTLY_DELETE: true -
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 @yigit 2026-04-30T07:40:50Z
Check document
Perform check on document:
