Real-time spam detection for phpBB 3.3.x forums, powered by the Spamtroll anti-spam API.
The extension scans:
- new forum posts (replies and topics),
- private messages,
- user registrations.
Verdicts come from the central Spamtroll service over HTTPS. When a piece of content is flagged as blocked, posting (or registration) is refused with a localised error message. When it falls in the suspicious zone, the same mechanism is used — the rest is left to the board moderators via the regular phpBB tooling.
- phpBB 3.3 or newer
- PHP 8.0+
- The
curlandjsonPHP extensions - A Spamtroll API key (sign up at https://spamtroll.io)
cd /path/to/phpbb/ext/
mkdir -p spamtroll && cd spamtroll
composer create-project spamtroll/phpbb phpbb --no-devThen enable the extension in the ACP under Customise → Manage extensions → Spamtroll Anti-Spam → Enable.
- Copy the extension into
ext/spamtroll/phpbb/inside your phpBB install. - Run
composer install --no-devfrom inside that directory to fetch the Spamtroll PHP SDK. - Enable the extension in the ACP.
The settings live under ACP → General → Spamtroll Settings:
| Setting | Default | Description |
|---|---|---|
| API key | (empty) | Your Spamtroll API key. Required. |
| API URL | https://api.spamtroll.io/api/v1 |
Endpoint base URL. |
| Timeout (s) | 5 |
HTTP timeout per request. |
| Spam threshold | 0.70 |
Normalised score (0–1) at and above which content is blocked. |
| Suspicious threshold | 0.40 |
Normalised score (0–1) at and above which content is flagged. |
| Check posts | on | Scan new posts. |
| Check PMs | on | Scan private messages. |
| Check registrations | on | Scan new user registrations. |
| Log retention (days) | 30 |
How long to keep entries in phpbb_spamtroll_log. |
A Test connection button verifies the configured API key and URL by
calling GET /scan/status through the SDK.
If Spamtroll is unreachable (timeout, network error, 5xx, malformed response), the extension lets the content through and writes a warning to the phpBB error log. Legitimate traffic is never blocked because of an outage on our side.
Released under the GNU General Public License, version 2 only
(GPL-2.0-only) — the license required by phpBB extensions. See LICENSE.