# Delete Mautic Contact List with one command

**URL:** <https://forum.mautic.org/t/delete-mautic-contact-list-with-one-command/29501>\
**Category:** Mautic 4 Install/Upgrade Support\
**Tags:** community, discussion\
**Created:** [October 2, 2023, 3:05am UTC](https://forum.mautic.org/t/delete-mautic-contact-list-with-one-command/29501 "2023-10-02T03:05:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![team](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@team](https://forum.mautic.org/u/team)\
**Post date:** [October 2, 2023, 3:05am UTC](https://forum.mautic.org/t/delete-mautic-contact-list-with-one-command/29501/1 "2023-10-02T03:05:47Z")

</div>

Hi everyone,

We developing a Node.js snippet to sync our Mautic contact database with Firebase Cloud. How do I delete all of my Mautic contacts after the sync transfer from Mautic to our Google Cloud database (e.g., Cron Jobs, command line, etc.)?

See the screenshot Mautic console image, which requires multiple deletions of 65 pages.

Regards,  
Hal  
DevCED Team

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [October 2, 2023, 6:47am UTC](https://forum.mautic.org/t/delete-mautic-contact-list-with-one-command/29501/2 "2023-10-02T06:47:28Z")

</div>

You wanna delete ALL contacts from Mautic?

**Statement below is destructive operation, proceed with caution.**

```auto
DELETE FROM leads;

```

Regards, M.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [October 2, 2023, 11:03am UTC](https://forum.mautic.org/t/delete-mautic-contact-list-with-one-command/29501/3 "2023-10-02T11:03:25Z")

</div>

I would like to point out, that @team might want to delete also associated tables?

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [October 2, 2023, 11:15am UTC](https://forum.mautic.org/t/delete-mautic-contact-list-with-one-command/29501/4 "2023-10-02T11:15:30Z")

</div>

If constraints in the database are set as they should be, mysql/mariadb should take care of that.

If that is not the case the other solution is to backup “the empty” database and after the sync. you just restore the backup (although I kind of like the first option better).

Regards, M.

---

<div class="post-metadata">

**Author:** ![team](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@team](https://forum.mautic.org/u/team)\
**Post date:** [October 2, 2023, 11:47am UTC](https://forum.mautic.org/t/delete-mautic-contact-list-with-one-command/29501/5 "2023-10-02T11:47:01Z")

</div>

table deleted

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [October 3, 2023, 11:47pm UTC](https://forum.mautic.org/t/delete-mautic-contact-list-with-one-command/29501/6 "2023-10-03T23:47:15Z")

</div>

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