WordPress plugin setup¶
The SpamAPI Anti-Spam plugin checks WordPress comments and the submissions of Contact Form 7, Gravity Forms and WPForms, without any coding. Setup takes a SpamAPI account, an API key and a few minutes in the WordPress admin.
Before you start¶
- WordPress 6.4 or newer and PHP 8.3 or newer.
- A SpamAPI account: create a free account, or sign in. The Free plan includes 100 checks a month.
- An API key from the dashboard's API keys page. The quickstart shows how to create one. Use a separate key for each site, so you can revoke one without affecting the others.
Use a current WordPress release receiving upstream security fixes. The plugin's minimum version is a compatibility floor, not a guarantee of upstream security support for older WordPress releases. PHP 8.3 receives security fixes through 31 December 2027; reassess the plugin's minimum before that date.
Compatibility checks cover WordPress 6.4 with PHP 8.3 and current WordPress with PHP 8.3, 8.4 and 8.5. For newer PHP versions, use a WordPress release listed as compatible in the WordPress PHP compatibility table.
Install¶
- Download the SpamAPI Anti-Spam plugin ZIP.
- In the WordPress admin, open Plugins → Add New Plugin → Upload Plugin.
- Select
spamapi-antispam.zip, click Install Now, then Activate Plugin.
For a manual installation, extract the ZIP and copy its spamapi-antispam
folder to wp-content/plugins/, then activate it from Plugins. The download
includes the PHP files, admin assets, and translations needed to run the plugin;
no Composer installation is required.
Connect your SpamAPI account¶
- Open Settings → SpamAPI and paste your API key into API Key. Leave API URL unchanged unless you run your own SpamAPI server.
- Click Save Settings, then Test Connection. It tests the saved key.
“Connection successful!” followed by your plan, such as
(free), means the plugin can reach SpamAPI. “Connection failed” is followed by the reason; see troubleshooting. - Under Enable SpamAPI, check Enable spam protection, choose a Strictness Level and click Save Settings again.
Protection stays off until it is enabled and a key is saved.
Configure¶
- Enable SpamAPI turns protection on. The plugin then checks WordPress comments and the submissions of every supported form plugin that is active.
- Strictness Level applies to all checks: Lenient blocks only obvious spam, Balanced (the default) blocks likely spam, and Strict blocks anything suspicious. Higher strictness may block more legitimate content.
If SpamAPI can't be reached or returns an error, the comment or form submission goes through unchecked and the plugin writes the error to the PHP error log. The same happens when the month's checks are used up or the key no longer works. The settings page shows this month's usage.
Supported comments and forms¶
| Source | What's checked | What happens to spam |
|---|---|---|
| WordPress comments | New comments from visitors, including signed-in users who can't moderate comments | The comment goes to the spam list under Comments, where you can mark it as not spam. A SpamAPI column shows each result. |
| Contact Form 7 | The text of the form's multi-line fields as the message, plus the sender's name and email address | Contact Form 7 treats the submission as spam: it isn't emailed to you, and the visitor sees the form's error message. |
| Gravity Forms | The name and email fields and the text of single-line, paragraph and post body fields | The entry is marked as spam; you find it among the form's spam entries. |
| WPForms | The name and email fields and the text of single-line and paragraph fields | The submission is refused, and the visitor sees “Your submission has been flagged as spam.” |
Pingbacks, trackbacks and comments from users who can moderate comments aren't checked. Contact Form 7 and Gravity Forms submissions that another spam check already caught aren't sent to SpamAPI and don't use a check. WPForms keeps no spam list, so a visitor whose message was wrongly refused has to reach you another way. Other form plugins aren't supported.
Check that it works¶
Sign out of WordPress, or open a private browser window, and post a comment or
submit a form with the email address spam@test.spamapi.com. SpamAPI always
classifies this test value as spam without using a check, so it
should end up as described above. Then send a normal message to confirm that it
goes through.
Each checked comment or submission uses one of your monthly checks. Follow them on the settings page or the dashboard's usage page.
Shared model contributions¶
Shared-model participation is optional and disabled by default, for both free and paid accounts. Ordinary checks and legacy feedback do not opt you in. Test the connection in Settings → SpamAPI to retrieve the operator's published contribution notice, policy version and configured retention period. Read it, confirm your authority, visitor notices and any required agreements, then enable the separate Shared spam model setting. This setting alone does not establish every permission needed for visitor data. Server training availability defaults to on once the operator has configured the notice, retention and ledger; each installation still chooses its own participation.
Configured sites with contributions off register a disabled installation in the background, including after a successful connection test. Once acknowledged, comment checks can use the shared model's canary scope without contributing labels. Registration leaves Shared spam model off and uploads no history.
Explicit moderator spam, not-spam and reviewed approval actions can submit minimized comment text, language, opaque installation/item IDs, label and content revisions, timestamps and an authorized prediction reference. Separate author names, email addresses, IPs and request headers are omitted. Text and hashes can still contain personal data. These examples go to dedicated storage for SpamAPI's shared statistical comment model; they do not fine-tune a hosted AI provider.
Moderation queues contributions locally and makes no network call. The queue is
bounded to 1,000 records and a seven-day event age; retries use backoff and server
retry delays. Budget waits do not exhaust transient-failure retries. Scheduled
workers wake at the actual queued due time; expired content is removed even when
an event is parked. Discarded events permit a fresh explicit moderation review.
Permanent contribution rejections discard their rejected batch; transient
outages, timeouts and budget waits keep the original events for retry.
Settings show pending work and failure codes. On low-traffic sites,
run wp cron event run --due-now from a real scheduler every minute. WP-CLI also
provides wp spamapi training status, drain and retry. Historical backfill
requires an explicit preview/confirmation; no history uploads on activation.
Disabling participation atomically replaces pending work with a withdrawal control. Storage failures leave a repair marker that workers process before sending any superseded enrollment or label. Deletion withdrawals take priority and can replace unsent labels when the queue is full; deleted-item watermarks remain until an accepted withdrawal or global opt-out so a failed local write can be retried. Wait for the server status to show disabled before removing credentials or uninstalling. Deactivation/uninstall attempt withdrawal and clear local data; if offline or credentials are revoked, ask the account owner to confirm remote withdrawal. A failed submission is never reported as ingested. Models affected by withdrawal are retired or retrained; deleting examples does not automatically unlearn their influence. Continue using normal spam checks with contribution off. Withdrawals are delivered separately and remain available during collection pauses or policy changes. Site URL changes queue an authenticated rebind; checks continue while that update is pending. Old-site sources are withdrawn and contributor trust returns to quarantine after the move.