# Best way for deleting 26.000 contacts of Mautic?

**URL:** <https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464>\
**Category:** Product Support\
**Created:** [August 12, 2021, 7:19pm UTC](https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464 "2021-08-12T19:19:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbntz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/paulbntz/32/544_2.png) [@paulbntz](https://forum.mautic.org/u/paulbntz)\
**Post date:** [August 12, 2021, 7:19pm UTC](https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464/1 "2021-08-12T19:19:05Z")

</div>

**Your software**  
My Mautic version is: 3.25  
My PHP version is: 7.4  
My Database type and version is: 10.2.40

**Your problem**  
My problem is:

Which is the best way for deleting 26.000 contacts from Mautic? With the less impact in the server if possible.

These errors are showing in the log:

Steps I have tried to fix the problem:

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [August 13, 2021, 12:17am UTC](https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464/2 "2021-08-13T00:17:04Z")

</div>

Truncate (empty) the leads table via Phpmyadmin

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/d0c33e89938d68e64d8066aa328b5173904c1a15.jpeg)

---

<div class="post-metadata">

**Author:** ![gordon.hu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gordon.hu/32/5622_2.png) [@gordon.hu](https://forum.mautic.org/u/gordon.hu)\
**Post date:** [August 13, 2021, 6:36am UTC](https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464/3 "2021-08-13T06:36:37Z")

</div>

I wrote a command to delete contact based on contact ID. 🤣

---

<div class="post-metadata">

**Author:** ![paulbntz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/paulbntz/32/544_2.png) [@paulbntz](https://forum.mautic.org/u/paulbntz)\
**Post date:** [August 13, 2021, 9:15am UTC](https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464/4 "2021-08-13T09:15:04Z")

</div>

Thanks @EJL will try this way. 🙂

---

<div class="post-metadata">

**Author:** ![paulbntz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/paulbntz/32/544_2.png) [@paulbntz](https://forum.mautic.org/u/paulbntz)\
**Post date:** [August 13, 2021, 9:16am UTC](https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464/5 "2021-08-13T09:16:13Z")

</div>

Hi @gordon.hu I have not so much experience in commands about Mautic, so I will be doing as @EJL suggested.

Thanks anyway.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [August 15, 2021, 6:11pm UTC](https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464/6 "2021-08-15T18:11:23Z")

</div>

another way to go about doing this is to create a segment with all the contacts you want to delete.  
Then go and create a campaign that starts with that segment and use the Action Delete Contact.

That will do the job as well.

---

<div class="post-metadata">

**Author:** ![paulbntz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/paulbntz/32/544_2.png) [@paulbntz](https://forum.mautic.org/u/paulbntz)\
**Post date:** [August 16, 2021, 8:13am UTC](https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464/7 "2021-08-16T08:13:41Z")

</div>

Hi Mikew, good point.

I don´t know why I don´t think in that way but you are right.

Thanks for sharing. 😉

---

<div class="post-metadata">

**Author:** ![kevin\_david\_k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kevin_david_k/32/2447_2.png) [@kevin\_david\_k](https://forum.mautic.org/u/kevin_david_k)\
**Post date:** [August 16, 2021, 9:42am UTC](https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464/8 "2021-08-16T09:42:10Z")

</div>

The first thing we’re prompted to do is to **choose a contact source**. In our case, our source of leads is coming from a segment. Find and select the segment that contains the contacts that you wish to see deleted from your database.

---

<div class="post-metadata">

**Author:** ![paulbntz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/paulbntz/32/544_2.png) [@paulbntz](https://forum.mautic.org/u/paulbntz)\
**Post date:** [August 16, 2021, 11:27am UTC](https://forum.mautic.org/t/best-way-for-deleting-26-000-contacts-of-mautic/20464/9 "2021-08-16T11:27:44Z")

</div>

Thanks @kevin_david_k for your answer.

More ways to solve it.

Have a good day.

The question is solved and I was personally able to delete all contacts.

Thank you all for your answers.
