# Delete attachments in upload file

**URL:** <https://community.gravityforms.com/t/delete-attachments-in-upload-file/15901>\
**Category:** General Discussion\
**Tags:** file-uploads, cosmicgiant, attachments, entry-automation\
**Created:** [September 20, 2023, 10:15am UTC](https://community.gravityforms.com/t/delete-attachments-in-upload-file/15901 "2023-09-20T10:15:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![user6113dc3eb0d53103](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user6113dc3eb0d53103/32/3676_2.png) [@user6113dc3eb0d53103](https://community.gravityforms.com/u/user6113dc3eb0d53103)\
**Post date:** [September 20, 2023, 10:15am UTC](https://community.gravityforms.com/t/delete-attachments-in-upload-file/15901/1 "2023-09-20T10:15:00Z")

</div>

Hi, I have a customer who receives a lot of attachments every day, which over the years accumulate to several GB. Is it possible to get Gravity form to delete attachments that are more than 1 year old, for example ?  
Thanks !

---

<div class="post-metadata">

**Author:** ![verysiberian](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/verysiberian/32/44_2.png) [@verysiberian](https://community.gravityforms.com/u/verysiberian)\
**Post date:** [September 20, 2023, 10:58am UTC](https://community.gravityforms.com/t/delete-attachments-in-upload-file/15901/2 "2023-09-20T10:58:32Z")

</div>

My group is working on a Gravity add-on that offers two new functions for entries: archive and slice.

Archive = sends the entry to a separate database table so that it’s no longer in gf\_entries and gf\_entry\_meta. Some of our sites have thousands of entries, which causes a huge performance hit over time. Of course, it’s possible to unarchive entries, too.

Slice = same as above but also deletes attachments.

This is not yet ready for widespread distribution, but I’ll get back to you when it is. In the meantime, a crude but effective method would be to browse to your Gravity Forms upload folders and simply sort the files by date to be purged manually.

Best regards,  
Rob

---

<div class="post-metadata">

**Author:** ![travislopes](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/travislopes/32/14645_2.png) [@travislopes](https://community.gravityforms.com/u/travislopes)\
**Post date:** [September 21, 2023, 9:16pm UTC](https://community.gravityforms.com/t/delete-attachments-in-upload-file/15901/3 "2023-09-21T21:16:09Z")

</div>

With [Entry Automation](https://cosmicgiant.com/plugins/entry-automation/), you can target entries submitted within a certain date range and delete select fields from an entry.

This would let you, for instance, target all entries that are at least a year old and delete any files uploaded to any of the file upload fields on the form.

---

<div class="post-metadata">

**Author:** ![user6113dc3eb0d53103](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user6113dc3eb0d53103/32/3676_2.png) [@user6113dc3eb0d53103](https://community.gravityforms.com/u/user6113dc3eb0d53103)\
**Post date:** [September 22, 2023, 7:16am UTC](https://community.gravityforms.com/t/delete-attachments-in-upload-file/15901/4 "2023-09-22T07:16:33Z")

</div>

Thanks for your solution, but it’s a pain to have to buy extension plugins :). I’m looking for a solution without that ideally.

---

<div class="post-metadata">

**Author:** ![user6113dc3eb0d53103](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user6113dc3eb0d53103/32/3676_2.png) [@user6113dc3eb0d53103](https://community.gravityforms.com/u/user6113dc3eb0d53103)\
**Post date:** [September 22, 2023, 7:17am UTC](https://community.gravityforms.com/t/delete-attachments-in-upload-file/15901/5 "2023-09-22T07:17:55Z")

</div>

> [@verysiberian](#):
>
> In the meantime, a crude but effective method would be to browse to your Gravity Forms upload folders and simply sort the files by date to be purged manually.

yes, it’s true and simple ! Thanks !

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [October 22, 2023, 7:18am UTC](https://community.gravityforms.com/t/delete-attachments-in-upload-file/15901/6 "2023-10-22T07:18:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
