# How to make an image orphaned so that it gets removed?

**URL:** https://meta.discourse.org/t/how-to-make-an-image-orphaned-so-that-it-gets-removed/79231
**Category:** Support
**Created:** [29 januari 2018 om 00:52 UTC](https://meta.discourse.org/t/how-to-make-an-image-orphaned-so-that-it-gets-removed/79231 "2018-01-29T00:52:45Z")
**Posts on this page:** 3
**Page:** 2

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [25 augustus 2021 om 14:40 UTC](https://meta.discourse.org/t/how-to-make-an-image-orphaned-so-that-it-gets-removed/79231/21 "2021-08-25T14:40:01Z")

</div>

> [@sam](#):
>
> First we need the rake task, that is definitely slotted. After we have that we can also add a site setting, default off for this behavior. `purge_images_from_deleted_posts_days` something like that.

Were these ever actioned? I can’t see a Rake task or a setting that will remove images from deleted posts.

When I look in at the old deleted posts (\> 1 year old) in our instance, the images are still there.

This matters at the moment as we are moving part of an instance which will involves a heap of topic deletions and historic uploads that need to be removed.

Another way to solve this would be to purge deleted posts and topics from the database, but I can’t see how to do that either.

## P.S.

continued here:

> [@Any api to purge old deleted posts / uploads](https://meta.discourse.org/t/any-api-to-purge-old-deleted-posts-uploads/73495/7):
>
> Call for Help! Can a clever person walk me through combining: AND to make an awesome orphaned uploads purger run from the console? I note that when I use rails db, I’m asked for Password for user discourse:. What do I do with that?

---

<div class="post-metadata">

### Author: ![Hooksmith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hooksmith/32/142826_2.png) [@Hooksmith](https://meta.discourse.org/u/Hooksmith)
#### Post date: [27 januari 2022 om 11:22 UTC](https://meta.discourse.org/t/how-to-make-an-image-orphaned-so-that-it-gets-removed/79231/23 "2022-01-27T11:22:14Z")

</div>

> [@nathank](#):
>
> Were these ever actioned? I can’t see a Rake task or a setting that will remove images from deleted posts.
> 
> When I look in at the old deleted posts (\> 1 year old) in our instance, the images are still there.

Same on our instance – would be great to have this. The expectation of a user is that the upload would get purged after 48 hours if their post is deleted, without first needing to edit the link out of the post.

Should we make a separate thread under #Contribute > Feature ?

---

<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: [8 juni 2024 om 12:36 UTC](https://meta.discourse.org/t/how-to-make-an-image-orphaned-so-that-it-gets-removed/79231/24 "2024-06-08T12:36:50Z")

</div>

This topic was automatically closed after 2322 days. New replies are no longer allowed.

[Vorige pagina](https://meta.discourse.org/t/how-to-make-an-image-orphaned-so-that-it-gets-removed/79231.md?page=1)
