# ODK Central - How to delete a submission

**URL:** <https://forum.getodk.org/t/odk-central-how-to-delete-a-submission/31609>\
**Category:** Support\
**Tags:** odk-central\
**Created:** [December 10, 2020, 3:40pm UTC](https://forum.getodk.org/t/odk-central-how-to-delete-a-submission/31609 "2020-12-10T15:40:12Z")\
**Posts on this page:** 1\
**Showing post:** 31

<div class="post-metadata">

**Author:** ![seewhy](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/seewhy/32/3199_2.png) [@seewhy](https://forum.getodk.org/u/seewhy)\
**Post date:** [October 27, 2024, 7:07pm UTC](https://forum.getodk.org/t/odk-central-how-to-delete-a-submission/31609/31 "2024-10-27T19:07:10Z")

</div>

That's my understanding - have a look at the thread that I linked to from @ktuite - it says "a daily cron job for purging deleted forms ... will do its work." and being a little 'retentive' I asked the very same question:

> [@Deleting media from Central submissions - does it reduce database size](https://forum.getodk.org/t/deleting-media-from-central-submissions-does-it-reduce-database-size/47321/4):
>
> The daily cron job that purges long-ago deleted forms is already running, yes. Nothing extra that you need to do!

Not sure if this will help, but here is a basic pyODK script that works for deleting specific attachments, so should be possible to adapt very slightly for the new delete submissions [remove `+'/attachments/'+str(filename)` from the end]... You will need to set up the credentials for pyODK - which are in the [DOCS](https://getodk.github.io/pyodk/#configure).

This would give you the opportunity to loop through a series of submissions and/or attachments in standard python methods - you may be far more skilled with pyODK, so please don't be offended by me offering this:

```auto
from pyodk.client import Client
client = Client()
projectId = [a number]
xmlFormId = 'your_form'
instanceId = 'uuid:...'
filename = 'e.g. epoch_time.jpg'
response = client.delete('/projects/'+str(projectId)+'/forms/'+str(xmlFormId)+'/submissions/'+str(instanceId)+'/attachments/'+str(filename))
print(str(instanceId)+' / '+str(filename)+' status: '+str(response.status_code))

```

(the projectId and xmlformId can be found in Central under the link 'analyse with OData' in the form submissions page)

Also, I don't know how to retrieve attachments that are in Trash - so some caution is required...

Good luck with the deletions and disk space recovery.

---

_[View the full topic](https://forum.getodk.org/t/odk-central-how-to-delete-a-submission/31609)._
