To delete all topics from a category, you will need access SSH access to your server. If you use managed Discourse hosting, get in touch with your provider and ask them to help. If you run your own server, here are the steps you need to take to delete all topics in a category:
This is a destructive action. Make sure to back up your forum before continuing
Find the “slug” of your category. This is the name of category used in the URL.
SSH into the server
./launcher enter app
(replace “mycategory” with the slug of your category)
Wait… this may take some time, depending how many topics you have
To delete topics in a subcategory, you need to supply the parent category slug as well. For example, if “childcategory” is a subcategory of “parentcategory”, the command would look like
This will delete all topics in all categories!
To delete all topics in all categories, you can use the command:
How long Discourse stores deleted topics? I can still access topics with direct link.
The topics remain in the database forever. Only staff will still be able to see deleted topics
How can I delete topics from the database?
Topics cannot be deleted from the database.
Would it be possible to restrict the topic deletion to a time period (between two dates)?
You’d need do it from the rails consoles, a command similar to the following should work:
Is category ID the position on the categories page?
The category ID is what you’d see if you do
For more information about other administrative operations please see:
Last Reviewed by @AlexDev on 2022-07-12T01:00:00Z