PHPackages                             cleantalk/yii2-antispam - 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. [Security](/categories/security)
4. /
5. cleantalk/yii2-antispam

ActiveYii2-extension[Security](/categories/security)

cleantalk/yii2-antispam
=======================

Anti-spam yii2 extension by CleanTalk with protection against spam bots and manual spam

v1.1.0(1y ago)1018.0k↓50%4[1 PRs](https://github.com/CleanTalk/yii2-antispam/pulls)GPL-3.0PHP

Since Jun 30Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/CleanTalk/yii2-antispam)[ Packagist](https://packagist.org/packages/cleantalk/yii2-antispam)[ RSS](/packages/cleantalk-yii2-antispam/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Spam Bot Protection for Yii2 Forms — reCAPTCHA Alternative.
===========================================================

[](#spam-bot-protection-for-yii2-forms--recaptcha-alternative)

Anti-spam extension for the Yii2 framework powered by the CleanTalk API.
Invisible protection from spam bots on contact, comment, and registration forms — no reCAPTCHA, no puzzles, no delays.

Features
--------

[](#features)

- Works invisibly in the background (no user interaction required)
- Blocks spam bots using CleanTalk’s multi-layered checks
- reCAPTCHA-free UX — no puzzles, images, or questions
- Easy integration into Yii2 forms and models
- Supports contact forms, comment forms, and registration forms

[![Build Status](https://camo.githubusercontent.com/bb52ff40ded0e409ce57de138a44019ab6f567f54e93604154588106c464487e/68747470733a2f2f7472617669732d63692e6f72672f436c65616e54616c6b2f796969322d616e74697370616d2e737667)](https://travis-ci.org/cleantalk/yii2-antispam)

### Websites that trust CleanTalk!

[](#websites-that-trust-cleantalk)

[![CleanTalk Anti-Spam Rating](https://camo.githubusercontent.com/843a75b91b5196d88d81383a0aad9cc9ecc14010dce1e8f15aa7016678998cca/68747470733a2f2f636c65616e74616c6b2e6f72672f7765627061636b2f696d672f636c65616e74616c6b5f726174696e672e706e67)](https://camo.githubusercontent.com/843a75b91b5196d88d81383a0aad9cc9ecc14010dce1e8f15aa7016678998cca/68747470733a2f2f636c65616e74616c6b2e6f72672f7765627061636b2f696d672f636c65616e74616c6b5f726174696e672e706e67)

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

[](#requirements)

- Yii 2.0 or above
- CleanTalk account

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist cleantalk/yii2-antispam

```

or add

```
"cleantalk/yii2-antispam": "~1.0.0"
```

to the require section of your composer.json.

\##Usage

1. Get access key on
2. Open your application configuration in protected/config/web.php and modify components section:

```
// application components
'components'=>[
    ...
        'antispam' => [
            'class' => 'cleantalk\antispam\Component',
            'apiKey' => 'Your API KEY',
        ],
    ...
],

```

3. Add validator in your model, for example ContactForm:

```
namespace app\models;

use cleantalk\antispam\validators\MessageValidator;
use Yii;
use yii\base\Model;

/**
 * ContactForm is the model behind the contact form.
 */
class ContactForm extends Model
{
    public $name;
    public $email;
    public $body;
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            // name, email, subject and body are required
            [['name', 'email', 'subject', 'body'], 'required'],
            // email has to be a valid email address
            ['email', 'email'],
            ['body', MessageValidator::className(), 'emailAttribute'=>'email', /*'nickNameAttribute'=>'name'*/]
        ];
    }
}

```

4. In form view add widget for hidden Javascript checks:

```

    ...

    ...

    ...

```

User registration validator
---------------------------

[](#user-registration-validator)

See cleantalk\\antispam\\validators\\UserValidator

Example rules:

```
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'email'], 'required'],
            ['email', 'email'],
            ['email', UserValidator::className(), 'nickNameAttribute'=>'name']
        ];
    }

```

\##License GNU General Public License

\##Resources

-
-

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance66

Regular maintenance activity

Popularity33

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~3383 days

Total

2

Last Release

585d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00cabd14ad0a24b6614de589e72519ff4433864097687217e62c2d80a10338ee?d=identicon)[CleanTalk](/maintainers/CleanTalk)

---

Top Contributors

[![psrustik](https://avatars.githubusercontent.com/u/804867?v=4)](https://github.com/psrustik "psrustik (14 commits)")[![Glomberg](https://avatars.githubusercontent.com/u/8588152?v=4)](https://github.com/Glomberg "Glomberg (3 commits)")[![svfcode](https://avatars.githubusercontent.com/u/74239490?v=4)](https://github.com/svfcode "svfcode (2 commits)")[![ArtemAnoshin](https://avatars.githubusercontent.com/u/36857361?v=4)](https://github.com/ArtemAnoshin "ArtemAnoshin (1 commits)")[![venera81](https://avatars.githubusercontent.com/u/220177689?v=4)](https://github.com/venera81 "venera81 (1 commits)")

---

Tags

anti-spamantispamcaptchaform-protectionphpspamspam-preventionspam-protectionyiiyii2yii2-extensionyii2-frameworkyii2antispamcleantalk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cleantalk-yii2-antispam/health.svg)

```
[![Health](https://phpackages.com/badges/cleantalk-yii2-antispam/health.svg)](https://phpackages.com/packages/cleantalk-yii2-antispam)
```

###  Alternatives

[cleantalk/yii-antispam

Anti-spam yii extension by CleanTalk with protection against spam bots and manual spam.

161.4k](/packages/cleantalk-yii-antispam)[cleantalk/laravel-antispam

Anti-spam laravel extension by CleanTalk with protection against spam bots and manual spam.

101.7k](/packages/cleantalk-laravel-antispam)

PHPackages © 2026

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