Download the PHP package cleantalk/php-antispam without Composer
On this page you can find all versions of the php package cleantalk/php-antispam. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-antispam
CleanTalk php-antispam: Lightweight Spam Protection for PHP Apps
============
Invisible spam protection: no CAPTCHA, puzzles, or math tests
A PHP client for the CleanTalk anti-spam API
If you find this project useful, please consider starring it on GitHub ⭐. It helps us improve and maintain the project.
Requirements
- PHP 5.6 or later
- cURL support
How does it stop spam?
This PHP library provides invisible spam protection for websites, registration forms, and comment sections. The CleanTalk API is a CAPTCHA alternative that detects spam without interrupting your users.
When a user submits a form, the library securely sends the form data to CleanTalk's cloud servers for analysis. CleanTalk then returns a real-time verdict identifying the submission as legitimate or spam. Your application decides how to handle that verdict.
CleanTalk vs CAPTCHA
| Feature | CleanTalk Anti-Spam | Traditional CAPTCHA |
|---|---|---|
| User Interaction | 100% invisible to users | Requires solving puzzles or clicks |
| Form Compatibility | Works with any PHP form | Often requires additional scripts |
| Speed | Instant cloud check | Slower due to user interaction |
| Accessibility | No visual tests | Can be difficult for screen-reader users |
CleanTalk is a PHP spam filter and CAPTCHA-free alternative that protects your forms without adding friction for users.
Getting started
Setup takes only a few minutes.
Step 1: install the SDK
Install the SDK with Composer:
Alternatively, download the ZIP archive and extract it into your project directory.
Step 2: configure your API key
First, copy your API key from your CleanTalk dashboard.
Make it available to PHP as an environment variable:
| Name | Value |
|---|---|
CLEANTALK_API_KEY |
Your CleanTalk API key |
On managed hosting, add it in the Environment variables or Secrets section of your hosting control panel, then restart the application if required.
If your application already loads a .env file, add:
PHP does not load .env files by itself; this option works only when your application or framework includes a dotenv loader. Do not put the API key in your PHP files or commit it to source control.
Step 3: add the CleanTalk handler to your form handler
Add the handler to your PHP code:
Step 4: add the JavaScript library to your HTML template
The library collects frontend data used for bot detection.
Enable the event token in your PHP handler:
Step 5: handle the API verdict
For example, stop processing when CleanTalk identifies a submission as spam:
Step 6 (optional): troubleshoot the integration
To identify possible configuration problems, log the improvement suggestions after calling handle():
See the complete form-handler example for context.
Step 7 (optional): get help
If you have questions, open a GitHub issue or contact us through our ticket system.
Examples
Looking for a universal integration?
See php-uni for a universal solution for CMS platforms and custom websites.
Websites that trust CleanTalk!

Learn more about CleanTalk as a reCAPTCHA alternative.