Skip to content

Akismet for PHP

Used by millions of websites, Akismet filters out hundreds of millions of spam comments from the Web every day. Add Akismet to your PHP applications so you don't have to worry about spam again.

Warning

The Akismet service requires an API key. If you are not already registered, sign up for an Akismet account.

Quick start

Install the latest version of Akismet for PHP with Composer package manager:

composer require cedx/akismet

For detailed instructions, see the installation guide.

Usage

There are three different types of calls to Akismet:

  1. Key verification will verify whether a valid API key is being used. This is especially useful if you will have multiple users with their own Akismet subscriptions using your application.
  2. Comment check is used to ask Akismet whether a given post, comment, profile, etc. is spam.
  3. Submit spam and submit ham are follow-ups to let Akismet know when it got something wrong (missed spam and false positives). These are very important, and you shouldn't develop using the Akismet API without a facility to include reporting missed spam and false positives.

Before integrating this library into your application, you should test your API calls to ensure a proper usage.