How to set delete time for attachments/images not rendered

when writing posts, we usually have to upgrade attachments and images, but sometime we have to replace the picture and attachments again and again and have to upload the file again and again.

So the old attachments we uploaded should be deleted if the attachments are not rendered/used by any topics or posts after a few days, or the attachments will consume a lot of space.

Can we set the deleting time? Like after 10 days, after 20 days, after 60 days?

They are automatically deleted. I think it happens every day. They get moved to tombstone. I think there is a setting to control when things get deleted from tombstone in site settings.

There are a few settings at /admin/site_settings/category/files you want to configure:

  • clean up uploads
  • clean orphan uploads grace period hours
  • purge deleted uploads grace period days

And if you are using s3 uploads, make sure to check s3 configure tombstone policy.