Hooks

Akismet

10 hooks fired by Akismet: 9 filters and 1 actions across 10 call sites.

10 hooks fired by Akismet: 9 filters and 1 actions across 10 call sites. 9 of the 10 call sites are described by a docblock, at the call or on the constant that names the hook; the rest are listed with their signature and call sites only. Paths are relative to the plugin directory.

xpac_akismet_check_record_days

Filter · 1 argument · 1 call site

Filters how many days an entry keeps what it was checked with.

After this a correction to the entry is no longer reported to Akismet. Zero or less keeps every record.

apply_filters( 'xpac_akismet_check_record_days', self::CHECK_RECORD_DAYS )
  • $days (int) — Days after the submission. Default 15.

Fired from:

  • packages/Akismet/Addon.php:2259

xpac_akismet_comment_check_data

Filter · 2 arguments · 1 call site

Filters the payload posted to Akismet's comment-check endpoint.

comment_content carries the answers to the form's own fields, except file, hidden and consent fields and the ones sent as the sender's name, email and website. Those four come from the form's field map, and an empty role is filled from the form's first email field, first website field or a field named for the sender's name. Password and confirmation values are already absent. The request's HTTP_* headers and REQUEST_URI are added as Akismet asks, without cookies, credentials, the REST nonce or any header named like a secret. This is the seam for withholding another field from the classifier: unset the key and it does not leave the site. Removing api_key or comment_content leaves the request unanswerable, so the check fails closed and the submission is quarantined.

apply_filters( 'xpac_akismet_comment_check_data', $data, $externalSubmission )
  • $data (array) — The request body, keyed as Akismet names its fields.
  • $submission (Submission) — A callback-safe copy without write-only answers.

Fired from:

  • packages/Akismet/Addon.php:1175

xpac_akismet_comment_type

Filter · 2 arguments · 1 call site

apply_filters( 'xpac_akismet_comment_type', $default, $submission )

Fired from:

  • packages/Akismet/Addon.php:1459

xpac_akismet_discard_certain_spam

Filter · 3 arguments · 1 call site

Filters whether Akismet's discard pro-tip throws the submission away.

Returning false restores the behaviour that shipped before the pro-tip was read: every refusal is quarantined and reviewable, including the blatant ones. The tip is only ever set on a spam verdict this package reached, so a callback here cannot affect any other detector.

apply_filters( 'xpac_akismet_discard_certain_spam', true, $submission, $verdict )
  • $discard (bool) — Whether to drop the submission. Default true.
  • $submission (Submission) — Submission that was refused.
  • $verdict (array) — Detector slug and reason.

Fired from:

  • packages/Akismet/Addon.php:1683

xpac_akismet_feedback_batch_size

Filter · 2 arguments · 1 call site

Filters how many entries one feedback job reports.

Each entry in a job costs one HTTP call, made in series, so this trades the number of scheduled jobs against how long any one of them runs. Clamped to 1–100.

apply_filters( 'xpac_akismet_feedback_batch_size', self::FEEDBACK_BATCH, $verdict )
  • $size (int) — Entries per job. Default 20.
  • $verdict (string) — "spam" or "ham".

Fired from:

  • packages/Akismet/Addon.php:1827

xpac_akismet_feedback_data

Filter · 3 arguments · 1 call site

Filters the payload posted to Akismet's submit-spam or submit-ham endpoint.

This is the comment-check payload as it was sent, read back from the entry, with the current credential and blog address put back on it. Akismet wants the original call reproduced, so a key removed or a field rewritten here weakens the correction rather than refining it.

apply_filters( 'xpac_akismet_feedback_data', $body, $verdict, $entryId )
  • $body (array) — The request body, keyed as Akismet names its fields.
  • $verdict (string) — "spam" or "ham".
  • $entryId (int) — Entry being corrected.

Fired from:

  • packages/Akismet/Addon.php:1917

xpac_akismet_is_test

Filter · 1 argument · 1 call site

Filters whether Akismet calls are flagged is_test.

A test call is answered normally and trains nothing, so this is the switch for a staging copy Akismet would otherwise learn from. Turning it on for a production site costs that site every spam report it would have contributed, and returning false on a development host restores the behaviour that shipped before.

apply_filters( 'xpac_akismet_is_test', $isTest )
  • $isTest (bool) — Whether to send is_test.

Fired from:

  • packages/Akismet/Addon.php:1533

xpac_akismet_missing_api_key

Action · 1 argument · 1 call site

Fires when a form asked for an Akismet check and no key answered.

The protected submission fails closed and is quarantined. The callback receives a copy without password or confirmation values.

do_action( 'xpac_akismet_missing_api_key', $externalSubmission )
  • $submission (Submission) — Redacted submission copy.

Fired from:

  • packages/Akismet/Addon.php:1066

xpac_akismet_request_timeout

Filter · 2 arguments · 1 call site

Filters the timeout, in seconds, of the Akismet comment-check request.

The call is synchronous and the visitor is waiting on it, so this is also the longest one attempt can hold a submission. The value is clamped to 1–30 seconds. A fast transport failure is retried once, so the worst case is roughly twice what this returns.

apply_filters( 'xpac_akismet_request_timeout', 15.0, $data )
  • $timeout (float) — Timeout in seconds. Default 15.
  • $data (array) — The request body about to be posted.

Fired from:

  • packages/Akismet/Addon.php:2066

xpac_forms_enable_verification

Filter · 3 arguments · 1 call site

Filters whether an anti-spam provider runs its check for this submission.

Evaluated only after the form's own toggle for the provider is already on, because the call is the right operand of a short-circuiting &&. Returning true therefore cannot switch on a check the form has turned off; returning false skips the check, leaving the validation result exactly as the preceding filters left it. Akismet does not ask at all for a submission no visitor's request is behind.

Each provider passes its own slug as the third argument, so a callback can disable one without touching the others. The slugs in use are "akismet" (this call site), "google-recaptcha" and "cloudflare-captcha". Forms' built-in Honeypot check never fires this filter and so cannot be disabled through it.

apply_filters( 'xpac_forms_enable_verification', true, $externalSubmission, 'akismet' )
  • $enable (bool) — Whether to run the provider's check. Default true.
  • $submission (Submission) — A callback-safe copy without write-only answers.
  • $provider (string) — Slug of the provider asking. Always "akismet" here.

Fired from:

  • packages/Akismet/Addon.php:1096

On this page