# How to clear anonymous contacts after 180 days instead of 365 days?

**URL:** https://forum.mautic.org/t/how-to-clear-anonymous-contacts-after-180-days-instead-of-365-days/28788
**Category:** Product Support
**Tags:** mautic-4
**Created:** [August 1, 2023, 10:54am UTC](https://forum.mautic.org/t/how-to-clear-anonymous-contacts-after-180-days-instead-of-365-days/28788 "2023-08-01T10:54:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![stgoos](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stgoos/32/8149_2.png) [@stgoos](https://forum.mautic.org/u/stgoos)
#### Post date: [August 1, 2023, 10:54am UTC](https://forum.mautic.org/t/how-to-clear-anonymous-contacts-after-180-days-instead-of-365-days/28788/1 "2023-08-01T10:54:00Z")

</div>

**Your software**  
My Mautic version is: 4.4.4  
My PHP version is: 7.4.3  
My Database type and version is: MySQL 8.0.33

**Your problem**  
My problem is: I would like to reduce the number of records in the users database. To do this, I would like to reduce the period after which anonymous contacts are being removed from the database from 365 days to 180 days. How/where can I configure this?

If it needs to be done via a config file for which FTP access is required, can you then tell me the file name and location and the parameter that needs to be adjusted? That way I can instruct the folks hosting the Mautic installation on what to do.

These errors are showing in the log: n/a

Steps I have tried to fix the problem: searched the forum

---

<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 1, 2023, 12:14pm UTC](https://forum.mautic.org/t/how-to-clear-anonymous-contacts-after-180-days-instead-of-365-days/28788/2 "2023-08-01T12:14:45Z")

</div>

You could actually just do this via segments and campaigns.

1. Create a segment with the filters email is empty and Visited URL Date less than -180 days.
2. Create a campaign starting with this segment, then add an Action to delete these contacts.

---

<div class="post-metadata">

### Author: ![stgoos](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stgoos/32/8149_2.png) [@stgoos](https://forum.mautic.org/u/stgoos)
#### Post date: [August 1, 2023, 3:16pm UTC](https://forum.mautic.org/t/how-to-clear-anonymous-contacts-after-180-days-instead-of-365-days/28788/3 "2023-08-01T15:16:58Z")

</div>

Briljant simple solution, thanks!

Does that “-180 days” work or does it need to be an actually set date?

It would be awesome if those 180 days limit could be dynamic.

---

<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 2, 2023, 5:29am UTC](https://forum.mautic.org/t/how-to-clear-anonymous-contacts-after-180-days-instead-of-365-days/28788/4 "2023-08-02T05:29:46Z")

</div>

No it is a dynamic parameter. So you could set it to the folllowing dynamic parmaters:  
is today  
is yesterday  
-1 day  
+1 day  
-7 weeks  
or really whatever

---

<div class="post-metadata">

### Author: ![stgoos](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stgoos/32/8149_2.png) [@stgoos](https://forum.mautic.org/u/stgoos)
#### Post date: [August 2, 2023, 7:39pm UTC](https://forum.mautic.org/t/how-to-clear-anonymous-contacts-after-180-days-instead-of-365-days/28788/5 "2023-08-02T19:39:32Z")

</div>

Great stuff, got it working 👍

---

<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: [August 4, 2023, 7:39am UTC](https://forum.mautic.org/t/how-to-clear-anonymous-contacts-after-180-days-instead-of-365-days/28788/6 "2023-08-04T07:39:38Z")

</div>

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