PHPackages                             leuchtfeuer/leuchtfeuer-housekeeping-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. leuchtfeuer/leuchtfeuer-housekeeping-bundle

ActiveMautic-plugin[Database &amp; ORM](/categories/database)

leuchtfeuer/leuchtfeuer-housekeeping-bundle
===========================================

A Mautic plugin that helps you to keep your database in a good shape

7.0.0(3mo ago)23399[1 PRs](https://github.com/Leuchtfeuer/mautic-housekeeping-bundle/pulls)GPL-3.0-or-laterPHPPHP ^8.1

Since Jul 22Pushed 3mo agoCompare

[ Source](https://github.com/Leuchtfeuer/mautic-housekeeping-bundle)[ Packagist](https://packagist.org/packages/leuchtfeuer/leuchtfeuer-housekeeping-bundle)[ RSS](/packages/leuchtfeuer-leuchtfeuer-housekeeping-bundle/feed)WikiDiscussions mautic5-7 Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (26)Used By (0)

Housekeeping by Leuchtfeuer
===========================

[](#housekeeping-by-leuchtfeuer)

Overview / Purpose / Features
-----------------------------

[](#overview--purpose--features)

This plugin provides a Mautic Housekeeping Command for database cleanup purposes.

Requirements / Version Support
------------------------------

[](#requirements--version-support)

- Mautic 6.0
- PHP 8.1 or higher

Installation
------------

[](#installation)

### Composer

[](#composer)

This plugin can be installed through composer.

### Manual Installation

[](#manual-installation)

Alternatively, it can be installed manually, following the usual steps:

- Download the plugin
- Unzip to the Mautic `plugins` directory
- Rename folder to `LeuchtfeuerHousekeepingBundle`
- In the Mautic backend, go to the `Plugins` page as an administrator
- Click on the `Install/Upgrade Plugins` button to install the Plugin. OR
- If you have shell access, execute `php bin\console cache:clear` and `php bin\console mautic:plugins:reload` to install the plugins.

Command
-------

[](#command)

Command to delete lead\_event\_log table entries, campaign\_lead\_event\_log table entries, email\_stats table entries where the referenced email entry is currently not published and email\_stats\_devices table entries.

Important: If referenced email is ever switched back to published, the contacts will get the email again.

```
bin/console leuchtfeuer:housekeeping

```

By default, entries older than 365 days are deleted from the CampaignLeadEventLog, LeadEventLog, EmailStats (only email\_stats entries that referenced emails entry is currently not published), EmailStatsDevices and PageHit tables.

### Parameter

[](#parameter)

```
-d  | --days-old                | Specifies the minimum age of the entries to be deleted. Default: 365 days
-r  | --dry-run                 | Execute as dry run. No entries will be deleted
-0  | --optimize-tables         | Runs OPTIMIZE TABLE on all Mautic tables after the entries have been deleted.
-i  | --cmp-id                  | Delete only data for a specific campaign ID from campaign_lead_event_log
-c  | --campaign-lead           | Only entries from the campaign_lead_event_log table will be deleted
-m  | --email-stats             | Only entries from the email_stats table where the referenced email entry is currently not published and from the email_stats_devices table will be deleted.
-t  | --email-stats-tokens      | Only set tokens fields in Email Stats Records to NULL instead of deleting the whole record
-l  | --lead                    | Only entries from the lead_event_log table will be deleted.
-p  | --page-hits               | Only entries from the page_hits table will be deleted.

```

### Notice

[](#notice)

- Every last entry from the campaign\_lead\_event\_log per campaign will be kept. This is due to contacts restarting campaigns if there is no last step preserved in the log.

### Deleting huge ammounts of data

[](#deleting-huge-ammounts-of-data)

- It might happen that the plugin fails to delete if the data is too large to handle. In that case: Create the following bash script and iterate through the deletion day by day:

```
#!/bin/sh
DOCROOT="path/to/mautic"
TIME="/usr/bin/time"
OUT="$DOCROOT/../log/housekeeping-loop.date +%Y%m%d_%H%M%S"
START=put_start_day_here #(for example 200)
END=put_end_day_here  #(for example 100)
OP="put_your_operator_here" #(for example "-m" for emails / "-p" for page_hits | needs to be in "")

seq $START -1 $END |while read i ; do
echo "********** $i **********" >> $OUT
$TIME -ao $OUT sudo -u www-data php $DOCROOT/bin/console leu:hou $OP -d $i 2>&1 >>$OUT
sleep 2
done

```

### Author

[](#author)

Leuchtfeuer Digital Marketing GmbH

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance82

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~68 days

Recently: every ~40 days

Total

20

Last Release

91d ago

Major Versions

v2.0-beta → v3.0.02023-07-07

v3.2.0 → v4.0.02024-02-05

4.0.2 → 5.0.02025-07-07

5.0.3 → 6.0.02025-10-06

5.0.4 → 7.0.02026-02-10

PHP version history (4 changes)v1.1PHP ^7.4

v3.0.0PHP ^8.0.2

v3.0.1PHP ^7.4|^8.0.2

6.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20301893?v=4)[Leuchtfeuer Digital Marketing](/maintainers/LeuchtfeuerDigitalMarketing)[@LeuchtfeuerDigitalMarketing](https://github.com/LeuchtfeuerDigitalMarketing)

---

Top Contributors

[![beetofly](https://avatars.githubusercontent.com/u/105105707?v=4)](https://github.com/beetofly "beetofly (22 commits)")[![LeonOltmanns](https://avatars.githubusercontent.com/u/55587275?v=4)](https://github.com/LeonOltmanns "LeonOltmanns (20 commits)")[![n-azimy](https://avatars.githubusercontent.com/u/86242419?v=4)](https://github.com/n-azimy "n-azimy (11 commits)")[![biozshock](https://avatars.githubusercontent.com/u/169384?v=4)](https://github.com/biozshock "biozshock (9 commits)")[![JonasLudwig1998](https://avatars.githubusercontent.com/u/146742086?v=4)](https://github.com/JonasLudwig1998 "JonasLudwig1998 (8 commits)")[![Bastian2718](https://avatars.githubusercontent.com/u/177823038?v=4)](https://github.com/Bastian2718 "Bastian2718 (4 commits)")[![elbebass](https://avatars.githubusercontent.com/u/441657?v=4)](https://github.com/elbebass "elbebass (4 commits)")[![PatrickJenkner](https://avatars.githubusercontent.com/u/139468697?v=4)](https://github.com/PatrickJenkner "PatrickJenkner (4 commits)")[![patrykgruszka](https://avatars.githubusercontent.com/u/8580942?v=4)](https://github.com/patrykgruszka "patrykgruszka (1 commits)")

---

Tags

pluginMauticintegrationcleanuphousekeeping

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/leuchtfeuer-leuchtfeuer-housekeeping-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/leuchtfeuer-leuchtfeuer-housekeeping-bundle/health.svg)](https://phpackages.com/packages/leuchtfeuer-leuchtfeuer-housekeeping-bundle)
```

###  Alternatives

[mautic/grapes-js-builder-bundle

GrapesJS Builder with MJML support for Mautic

5684.1k4](/packages/mautic-grapes-js-builder-bundle)[etailors/mautic-amazon-ses

Amazon SES Mailer Plugin for Mautic

522.0k](/packages/etailors-mautic-amazon-ses)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
