PHPackages                             ernestdefoe/janitor - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ernestdefoe/janitor

ActiveFlarum-extension[Utility &amp; Helpers](/categories/utility)

ernestdefoe/janitor
===================

Janitor for Flarum 2 — automated, rules-based discussion housekeeping. Define rules that periodically find discussions in chosen tags matching conditions (age, tags, reply count) and hide, lock, retag/move, or delete them. Scheduler-driven, with a global dry-run, per-run caps, and an action log.

v1.3.1(1mo ago)010MITPHPPHP ^8.3CI passing

Since Jun 28Pushed 1mo agoCompare

[ Source](https://github.com/ernestdefoe/janitor)[ Packagist](https://packagist.org/packages/ernestdefoe/janitor)[ Docs](https://github.com/ernestdefoe/janitor)[ RSS](/packages/ernestdefoe-janitor/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Janitor
=======

[](#janitor)

Automated, rules-based discussion housekeeping for **Flarum 2**.

Define rules that periodically look inside chosen tags for discussions matching conditions (age, tags, reply count) and then **hide**, **lock**, **retag / move**, or **delete** them — so a busy section keeps itself tidy without manual moderator work.

> Inspired by the "auto-archive old/prefixed threads" plugins from other forum software, rebuilt the Flarum way (tags instead of forum IDs).

Features
--------

[](#features)

- **Rules** — each rule has a *scope* (one or more tags, or all), *conditions*, an *action*, and its own *run frequency*.
- **Conditions** — inactive/created for N days, also has / doesn't have certain tags, minimum / maximum replies.
- **Actions** — hide, lock, unlock, add tag, remove tag, move (retag), or permanently delete.
- **Scheduler** — due rules run automatically; you can also **Run** or **Preview** any rule on demand from the admin page.
- **Global dry-run** — preview everything: rules log what they *would* do and change nothing. Flip it off when you're confident.
- **Audit-log friendly** — every live action dispatches the matching Flarum domain event (`Hidden`, `Deleted`, tag/lock events), so audit-log / action-log extensions record Janitor's actions automatically, attributed to an admin. (Dry-run previews never emit them.)
- **Safety** — stickied and locked discussions are protected by default, every run is capped (default 100 actions), permanent delete is opt-in per rule, and every (would-be) action is written to an **action log**. A rule can opt in to **include locked** (e.g. archiving closed-and-locked sale threads) or **include stickied** discussions when that's exactly what it's for; the Unlock action always includes locked discussions.
- **Every condition is optional** — a rule can match on tags alone (no inactivity needed), on inactivity alone, or any combination.

Install
-------

[](#install)

```
composer require ernestdefoe/janitor:"*"
php flarum migrate
php flarum cache:clear
```

Then enable **Janitor** in the admin panel and open its settings to add rules.

Requirements: the scheduler
---------------------------

[](#requirements-the-scheduler)

Janitor's automatic runs rely on Flarum's task scheduler, so your server must run this cron entry (once a minute):

```
* * * * * cd /path/to/forum && php flarum schedule:run >> /dev/null 2>&1
```

Without it, rules won't run on their own — but the **Run** / **Preview** buttons on the settings page work regardless, and are the safest way to try a rule first.

Tips
----

[](#tips)

- Start with **Global dry-run** on and use **Preview** to see exactly which discussions a rule would hit (check the action log) before letting it act.
- Prefer **Hide** or **Move** over **Delete** — hidden discussions can be restored; deletion can't.
- "Inactive for N days" measures last activity by default — ideal for archiving stale threads in a busy tag.

License
-------

[](#license)

[MIT](LICENSE.md) © ernestdefoe

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance92

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~2 days

Total

5

Last Release

38d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9978664264055711c21fbcf73c937f758df771d9cb40f6a25370b10123e7abc?d=identicon)[ernestdefoe](/maintainers/ernestdefoe)

---

Top Contributors

[![ernestdefoe](https://avatars.githubusercontent.com/u/24905286?v=4)](https://github.com/ernestdefoe "ernestdefoe (6 commits)")

---

Tags

schedulerautomationarchiveflarummoderationcleanupflarum-extension

### Embed Badge

![Health badge](/badges/ernestdefoe-janitor/health.svg)

```
[![Health](https://phpackages.com/badges/ernestdefoe-janitor/health.svg)](https://phpackages.com/packages/ernestdefoe-janitor)
```

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

13129.1k](/packages/flarum-lang-russian)[fof/byobu

Well integrated, advanced private discussions.

59126.7k15](/packages/fof-byobu)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

1941.0k](/packages/flarum-lang-french)[fof/polls

 A Flarum extension that adds polls to your discussions

26137.4k9](/packages/fof-polls)[fof/discussion-language

Specify the language a discussion is written in &amp; sort by language

1035.6k7](/packages/fof-discussion-language)[fof/masquerade

User profile builder extension for your Flarum forum.

2026.0k6](/packages/fof-masquerade)

PHPackages © 2026

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