# Problems with Removing Contacts from Campaign

**URL:** <https://forum.mautic.org/t/problems-with-removing-contacts-from-campaign/29183>\
**Category:** Product Support\
**Created:** [September 4, 2023, 2:00pm UTC](https://forum.mautic.org/t/problems-with-removing-contacts-from-campaign/29183 "2023-09-04T14:00:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)\
**Post date:** [September 4, 2023, 2:00pm UTC](https://forum.mautic.org/t/problems-with-removing-contacts-from-campaign/29183/1 "2023-09-04T14:00:40Z")

</div>

**Your software**  
My Mautic version is: 4.4.6  
My PHP version is: 7.4.33  
My Database type and version is: Percona 8.0.33-25

**Your problem**  
My problem is:  
I have one campaign where I can only add users but not remove them. Not in the front end and not via API.

These errors are showing in the log:  
[2023-09-04 10:42:23] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO campaign\_lead\_event\_failed\_log( `log_id`, `date_added`, `reason`) SELECT id, :dateAdded as date\_added, :message as reason from campaign\_lead\_event\_log WHERE is\_scheduled = 1 AND lead\_id = :contactId AND campaign\_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':dateAdded as date\_added, :message as reason from campaign\_lead\_event\_log WHERE ’ at line 2 {“hostname”:“0e0b8ad87d42”,“pid”:918415}  
Showing this error about once a minute.

Steps I have tried to fix the problem:  
Cleared the cache

---

<div class="post-metadata">

**Author:** ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)\
**Post date:** [September 13, 2023, 5:39am UTC](https://forum.mautic.org/t/problems-with-removing-contacts-from-campaign/29183/2 "2023-09-13T05:39:48Z")

</div>

I found out that marking contacts as bounce is also not working anymore in this instance. Having some serious problems with that.

---

<div class="post-metadata">

**Author:** ![zwf](https://avatars.discourse-cdn.com/v4/letter/z/f475e1/32.png) [@zwf](https://forum.mautic.org/u/zwf)\
**Post date:** [September 13, 2023, 12:37pm UTC](https://forum.mautic.org/t/problems-with-removing-contacts-from-campaign/29183/3 "2023-09-13T12:37:45Z")

</div>

Hello !

I suppose the method differs if you want to remove a few or a lot of contacts.

If it concerns a few contacts, I would try creating a [tag] or a segment B for those contacts. Add this tag or segment B to those specific contacts in each contact page.

Then, if you exclude this tag/segment B in your filter’s segment A, it should work.

If you have to remove a lot of contact, it is better to have a common factor to apply a filter in the segment. One example I have, but I don’t know if it could actually help you : create a campaign based on one condition, let’s say they have reached 50 points or clicked a specific link, then you can add a tag or include those contacts in a new segment B. Filter the segment A excluding tag or excluding segment B.

Good luck !

---

<div class="post-metadata">

**Author:** ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)\
**Post date:** [October 13, 2023, 3:12pm UTC](https://forum.mautic.org/t/problems-with-removing-contacts-from-campaign/29183/4 "2023-10-13T15:12:17Z")

</div>

My problem was a different one, that something in the config or the database was not allowing any kind of removal from a campaign, no matter what method used. I did a fresh installation and migrated the data and now it works.
