# Delete deleted-posts permanently in bulk?

**URL:** https://meta.discourse.org/t/delete-deleted-posts-permanently-in-bulk/203289
**Category:** Support
**Created:** [September 12, 2021, 4:15am UTC](https://meta.discourse.org/t/delete-deleted-posts-permanently-in-bulk/203289 "2021-09-12T04:15:12Z")
**Posts on this page:** 1
**Showing post:** 14

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [September 17, 2021, 7:27am UTC](https://meta.discourse.org/t/delete-deleted-posts-permanently-in-bulk/203289/14 "2021-09-17T07:27:59Z")

</div>

> [@nathank](#):
>
> I also remain unsure of how to get rid of the uploads associated with my deleted posts. Both are causing quite a headache at the mo.

I _think_ the attachments will be cleaned up by one of the daily jobs, as long as they’re not part of the latest version of the post. So changing the deleted post to ‘(deleted by admin)’ or something would make its attachment part of the edit history and would then orphan it (thus scooping it up in the ‘clear orphan’ clean-up).

I am only theorising though, so this may be wrong. 🙂

Source:

> [@How to make an image orphaned so that it gets removed?](https://meta.discourse.org/t/how-to-make-an-image-orphaned-so-that-it-gets-removed/79231/3):
>
> All the details are available in this job
> 
> [https://github.com/discourse/discourse/blob/master/app/jobs/scheduled/clean\_up\_uploads.rb](https://github.com/discourse/discourse/blob/master/app/jobs/scheduled/clean_up_uploads.rb)
> 
> TL;DR: an image is orphaned if and only if it’s not referenced
> 
> - in the latest version of a post
> - in a draft
> - in a queued post
> - in a logo site setting
> - in a custom emoji
> - in a theme
> - in a user avatar/background/card image
> - in a category logo/background image

---

_[View the full topic](https://meta.discourse.org/t/delete-deleted-posts-permanently-in-bulk/203289)._
