Actually delete permanently without all the obstacles

Would love an option to actually delete post/topic, without being stuck at every turn to do so its making it harder.

This should just have a checkbox to say I am aware that will happen and want to anyway. Not force me to potentially have to manually delete every post in super long topics

or like Reddit I should be able to really delete just the first post make it empty.

I understand there will be many that say something like “but the replies may be important for others/posterity”. I cannot stress how little that matters and we just don’t care if all the replies are deleted.

and should not have to do this for every single post

3 Likes

I think this could work well as an enum site setting, with the existing behaviour remaining the default. For example, permanent_topic_deletion_mode could offer the current “require each post to be permanently deleted first” behaviour and an opt-in “permanently delete topic and all posts” behaviour, still behind the existing typed confirmation. That would preserve the current safety policy for existing sites while allowing admins who explicitly want bulk deletion to opt into it.

A quick progress update after digging into the existing permanent-deletion code:

I found that Discourse already has the actual bulk deletion behaviour needed here. When the first post is permanently destroyed, PostDestroyer can already recursively permanently destroy the remaining posts in the topic. The restriction is mainly in the permission/policy checks which currently require the other posts to be permanently deleted first.

I’ve therefore moved away from the site-wide enum I suggested above and have a working implementation using a more conservative opt-in model:

  • the existing can_permanently_delete setting remains the master switch
  • there is an additional hidden operator-level gate, disabled by default
  • when both are enabled, each admin can individually opt in under Preferences → Interface
  • one admin opting in does not change the behaviour for any other admin
  • disabling the hidden gate immediately restores the existing behaviour globally
  • the existing permanent-deletion confirmation and other safeguards remain in place

The preference is currently labelled:

Allow permanent topic deletion to delete all posts

with the explanation:

When permanently deleting a topic, also permanently delete all remaining posts instead of requiring them to be permanently deleted individually.

I’ve added backend policy/security tests, controller coverage confirming that the topic and all remaining posts are actually permanently removed, serializer/API coverage, and frontend acceptance tests for the preference visibility and saving. Those are passing.

I’m also looking at recording changes to this per-admin opt-in in the Staff Action Logs, since enabling a more destructive deletion mode seems worth having as a timestamped audit event.

I’ll post the GitHub PR once I’ve finished that and the final review.

A final update: the implementation is now up as a ready-for-review PR:

The final design is the per-admin opt-in approach described above rather than the site-wide enum I originally suggested.

A couple of UX details were added during the final pass:

  • the per-admin preference is shown under Preferences → Interface when the site-level gates allow it
  • when an opted-in admin permanently deletes the first post/topic, the irreversible confirmation now explicitly says that it will permanently delete the topic and all replies
  • when the admin is not opted in, the existing behaviour and wording remain unchanged
  • the existing same-admin permanent-delete cooldown is still enforced
  • preference changes are recorded in Staff Action Logs

I also manually tested the complete opted-in path on a disposable topic with two replies and verified afterward that the topic and all of its posts had been removed from the database.

The main GitHub test/lint checks have passed; the PR is now waiting for review, with the security scan still queued at the time of writing.

1 Like