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 hidden site setting to allow admins to permanently delete data.
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_delete
totrue
:
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.yml
file 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 @SaraDev 2024-09-17T23:55:45Z
Check document
Perform check on document: