PHPackages                             silverstripe/akismet - 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. silverstripe/akismet

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

silverstripe/akismet
====================

Akismet antispam module for Silverstripe

4.5.1(2y ago)2145.0k↑33.3%6[4 issues](https://github.com/silverstripe/silverstripe-akismet/issues)1BSD-3-ClausePHPPHP ^7.4 || ^8.0CI failing

Since Feb 19Pushed 1y ago4 watchersCompare

[ Source](https://github.com/silverstripe/silverstripe-akismet)[ Packagist](https://packagist.org/packages/silverstripe/akismet)[ RSS](/packages/silverstripe-akismet/feed)WikiDiscussions 5 Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (43)Used By (1)

Akismet Silverstripe Module
===========================

[](#akismet-silverstripe-module)

[![CI](https://github.com/silverstripe/silverstripe-akismet/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/silverstripe-akismet/actions/workflows/ci.yml)

Simple spam filter for Silverstripe using Akismet

Also, please [report any issues](https://github.com/tractorcow/silverstripe-akismet/issues)you may encounter, as it helps us all out!

Please see [the changelog](changelog.md) for module history.

Credits and Authors
-------------------

[](#credits-and-authors)

- Damian Mooyman -
- Attribution to Tijs Verkoyen for his Akismet API wrapper -

Requirements
------------

[](#requirements)

- Silverstripe ^4 || ^5
- Silverstripe SpamProtection module -
- Tijs Verkoyen's Akismet API wrapper -

**Note:** For a Silverstripe 4.x compatible version, please use 4.x release.

Installation Instructions
-------------------------

[](#installation-instructions)

This module can be easily installed on any already-developed website

- You can install using Composer, as below:

```
composer require silverstripe/akismet
```

`AkismetSpamProtector` is automatically assigned as the default spam protector class.

- Get an API key from [akismet.com](http://akismet.com/) and set in the site against one of the following ways.

config.yml:

```
---
Name: myspamprotection
---
SilverStripe\Akismet\AkismetSpamProtector:
  api_key: 5555dddd55d5d
```

\_config.php:

```
use SilverStripe\Akismet\AkismetSpamProtector;

AkismetSpamProtector::singleton()->setApiKey('5555dddd55d5d');
```

.env:

```
SS_AKISMET_API_KEY="5555dddd55d5d"

```

If instead you want to configure your akismet key via the siteconfig (as a password field) you can add the included extension to SiteConfig

mysite/\_config/settings.yml:

```
SilverStripe\SiteConfig\SiteConfig:
  extensions:
    - SilverStripe\Akismet\Config\AkismetConfig
```

### Priority of defined API keys

[](#priority-of-defined-api-keys)

Please note that the API key values defined in the various ways above will be prioritised as:

1. Values assigned to the singleton via `AkismetSpamProtector::singleton()->setApiKey()`
2. Values defined in configuration, whether YAML or in \_config.php files with `Config::modify()->set(...)`
3. Values defined in the environment via .env

Testing
-------

[](#testing)

By default, spam protection is disabled for users with ADMIN priviliges. There is also an option to disable spam protection for all logged in users. In order to disable this for testing purposes, you can temporarily modify these options in your development environment as below:

```
use SilverStripe\Akismet\AkismetSpamProtector;
use SilverStripe\Control\Director;
use SilverStripe\Core\Config\Config;

if (!Director::isLive()) {
	Config::modify()->remove(AkismetSpamProtector::class, 'bypass_permission');
	Config::modify()->remove(AkismetSpamProtector::class, 'bypass_members');
}
```

In order to check that your form is blocking spam correctly, you can always set 'viagra-test-123' as the author and Akismet will always mark this as spam.

Comments
--------

[](#comments)

If you're using Comments module you can quickly set akismet to filter these out by adding the `CommentSpamProtection`extension to the `CommentingController`

config.yml

```
SilverStripe\Comments\Controllers\CommentingController:
  extensions:
    - CommentSpamProtection
```

If necessary, you can also mark spam comments to be saved to the database. This will still display the spam rejection notice, but spam comments will now be available for moderation in the backend. In order to enable this feature add the following to your configuration.

config.yml

```
# Allows spam posts to be saved for review if necessary
SilverStripe\Akismet\AkismetSpamProtector:
  save_spam: true
```

Custom Form Usage
-----------------

[](#custom-form-usage)

To enable spam protection in your custom forms, call the enableSpamProtection method with your field names mapped to the akismet fields:

```
$form  = new Form($this, 'Form', $fields, $actions, $validator);
$form->enableSpamProtection(array(
  'mapping' => array(
    'Name' => 'authorName',
    'Email' => 'authorMail',
    'Comments' => 'body'
    )
  )
);

```

Important notes for those in the EU
-----------------------------------

[](#important-notes-for-those-in-the-eu)

Because of the way Akismet works (message, author, and other information sent to a third party) in some countries it's legally necessary to notify and gain the user's permission prior to verification.

To create a checkbox style authorisation prompt for this field set the following configuration option:

config.yml

```
SilverStripe\Akismet\AkismetSpamProtector:
  require_confirmation: true
```

\_config.php

```
Config::modify()->set(AkismetSpamProtector::class, 'require_confirmation', true);
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community29

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor4

4 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 ~93 days

Recently: every ~124 days

Total

42

Last Release

652d ago

Major Versions

3.2.7 → 4.0.0-beta12017-12-18

3.2.x-dev → 4.0.32019-11-17

4.5.x-dev → 5.x-dev2024-08-05

PHP version history (2 changes)4.2.0-beta1PHP ^7.3 || ^8.0

4.3.0PHP ^7.4 || ^8.0

### Community

Maintainers

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

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

![](https://www.gravatar.com/avatar/afbb3dcc9ef29c1a6eedd6addcae5fce9ab1271915a85a4c349301b71237368d?d=identicon)[silverstripe-machine01](/maintainers/silverstripe-machine01)

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

![](https://avatars.githubusercontent.com/u/1168676?v=4)[Maxime Rainville](/maintainers/maxime-rainville)[@maxime-rainville](https://github.com/maxime-rainville)

---

Top Contributors

[![emteknetnz](https://avatars.githubusercontent.com/u/4809037?v=4)](https://github.com/emteknetnz "emteknetnz (18 commits)")[![GuySartorelli](https://avatars.githubusercontent.com/u/36352093?v=4)](https://github.com/GuySartorelli "GuySartorelli (12 commits)")[![dhensby](https://avatars.githubusercontent.com/u/563596?v=4)](https://github.com/dhensby "dhensby (11 commits)")[![robbieaverill](https://avatars.githubusercontent.com/u/5170590?v=4)](https://github.com/robbieaverill "robbieaverill (8 commits)")[![wilr](https://avatars.githubusercontent.com/u/101629?v=4)](https://github.com/wilr "wilr (6 commits)")[![raissanorth](https://avatars.githubusercontent.com/u/14869519?v=4)](https://github.com/raissanorth "raissanorth (5 commits)")[![assertchris](https://avatars.githubusercontent.com/u/200609?v=4)](https://github.com/assertchris "assertchris (5 commits)")[![jon-shape](https://avatars.githubusercontent.com/u/3586038?v=4)](https://github.com/jon-shape "jon-shape (4 commits)")[![tractorcow](https://avatars.githubusercontent.com/u/936064?v=4)](https://github.com/tractorcow "tractorcow (4 commits)")[![dnsl48](https://avatars.githubusercontent.com/u/9313746?v=4)](https://github.com/dnsl48 "dnsl48 (3 commits)")[![Makreig](https://avatars.githubusercontent.com/u/6011781?v=4)](https://github.com/Makreig "Makreig (2 commits)")[![ScopeyNZ](https://avatars.githubusercontent.com/u/3260989?v=4)](https://github.com/ScopeyNZ "ScopeyNZ (2 commits)")[![scott1702](https://avatars.githubusercontent.com/u/10215604?v=4)](https://github.com/scott1702 "scott1702 (2 commits)")[![NightJar](https://avatars.githubusercontent.com/u/778003?v=4)](https://github.com/NightJar "NightJar (2 commits)")[![bergice](https://avatars.githubusercontent.com/u/541886?v=4)](https://github.com/bergice "bergice (1 commits)")[![elliot-sawyer](https://avatars.githubusercontent.com/u/354793?v=4)](https://github.com/elliot-sawyer "elliot-sawyer (1 commits)")[![asecondwill](https://avatars.githubusercontent.com/u/156546?v=4)](https://github.com/asecondwill "asecondwill (1 commits)")[![chillu](https://avatars.githubusercontent.com/u/111025?v=4)](https://github.com/chillu "chillu (1 commits)")[![brettt89](https://avatars.githubusercontent.com/u/4122344?v=4)](https://github.com/brettt89 "brettt89 (1 commits)")[![sabina-talipova](https://avatars.githubusercontent.com/u/87288324?v=4)](https://github.com/sabina-talipova "sabina-talipova (1 commits)")

---

Tags

hacktoberfestsilverstripespamAkismet

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/silverstripe-akismet/health.svg)

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

PHPackages © 2026

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