# Ticket löschen

<p class="callout danger">The commands listed here cause **irrecoverable data loss**! Only proceed if you know what you’re doing and you [<span class="doc">have a backup</span>](https://docs.zammad.org/en/latest/appendix/backup-and-restore/index.html)!</p>

<p class="callout info">Please note that this is not a full command list, if you’re missing commands, feel free to ask over at the [Community](https://community.zammad.org/).</p>

## Removing Tickets (And Their Articles)

```
# Delete a ticket (specified by database ID)
>> Ticket.find(4).destroy

# Delete all tickets
>> Ticket.destroy_all

# Keep some tickets (specified by database ID); delete the rest
>> tickets_to_keep = [1, 2, 3]
>> Ticket.where.not(id: tickets_to_keep).destroy_all
```

[https://docs.zammad.org/en/latest/admin/console/dangerzone-for-experts.html#removing-tickets-and-their-articles](https://docs.zammad.org/en/latest/admin/console/dangerzone-for-experts.html#removing-tickets-and-their-articles)