Join the top marketers who read our newsletter each week.

How to delete contacts in bulk in Mautic

Whether you want to delete every contact that has never been active in your database, that does not have an email address or every lead that filled wrong information (Looking at you Mr Nope Nope), Mautic does not make it easy to delete more than a 100 contacts at a time. If you’re like me and have to delete multiple thousands of contacts at once, you probably pushed back the idea of doing it manually… Until today.

Although doing this could be way simpler if the peeps behind Mautic would allow to delete contacts from the database that are a part of a specific segment from the segment view, it turns out that the way I discovered is actually not that complex and could potentially saves you a truck load of time. So let’s dig right into it.

The first thing we want to do is create a segment that would filter the database to only have the contacts that you want to remove from your list of leads. In my case, I wanted to delete every contact that does not have an email address in Mautic and that is from France :

You can also see that I chose to filter by “Page hit Source ID” with an empty value. The reason behind this is that I had some “contacts” that were only an IP Address. These contacts appear to contacts that have anonymous tracking turned on (Source). The hope is that one day, they will be a part of my database and the computer will recognize them from their IP Address and merge this recorded activity to their new profile.

Now that we have our segment that contains all of the contacts that we want to permanently remove from our database, it is time to head into our Campaigns panel.

Here, we want to create a new Campaign. Once you gave it a name, it is time to launch the Campaign Builder.

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.

After that, we want to create an action.

The next step is to choose the action “Delete a Contact“. You will then be prompted to give a name to this action and be given a warning that this action is irreversible. So be aware. But I think you knew that. You can then choose to execute this action immediately or at a time of your choosing.

Once this “campaign” is set up, you can publish it and wait for the cron job that triggers the campaigns to do its job!

You can monitor the wellbeing of your Campaign and whether or not it has worked by finding the segment that should be impacted by your decision and look at the number of contacts it has. In my case, the number dropped from 2248 contacts to… No contacts at all. Success!

The great thing about this way of doing is that it can be set and forgotten about. This is kind of a double edged sword but keep in mind that as long as your segment and your campaign are published, every contact that will fit the criteria(s) of your Segment’s filters will be passed onto the Campaign set actions. Meaning that in my case, if I ever import a new batch of contacts from France and that some of them do not have an email address, they will be processed and deleted in the hour that follows without my knowledge.

In my case, that’s good, I like that. But if you would like to take a look at the contacts you’re going to delete, I highly suggest you unpublish the Campaign to let the segment builds itself and give you the opportunity to check once in a while whether or not you want to save some of the contacts.

And that wraps it for me! I hope this dandy handy trick is going to save you as much time as it saved me and maybe gave you some ideas on how to ensure you keep a clean and relevant database at all times.

Once again, if you have any question, you can reach out to me by mail or by leaving a reply down below. Thank you for your time!

Join the top marketers who read our newsletter each week.

Yaniss Illoul

Share on twitter
Share on linkedin
Share on facebook
Share on reddit

You might also like these posts:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

function external_link_attribute() { ?>

wait!

Get more tutorials, guides and curated content !

In your inbox, once a week.

HELLO!

Get more tutorials, guides and curated content !

In your inbox, once a week.