AI Summary
Description
The wpforms_process_is_block_submission_by_spam_filtering_enabled filter lets you control whether WPForms should block a submission entirely when it is flagged by spam filtering checks.
This is useful when you want certain spam filtering protections (such as the Country Filter) to discard submissions instead of allowing them to continue through processing or be stored as spam entries.
This behavior is relevant for cases where modern anti-spam protection and storing spam entries in the database are enabled, but you still want specific spam-filtered submissions to be fully blocked.
Parameters
| parameter | type | description |
|---|---|---|
$enabled | bool | Determines whether WPForms should block spam-filtered submissions. Default is the WPForms internal value. |
Source
wpforms/includes/class-process.php
More Information
This filter is applied during form processing when WPForms determines whether a submission should be blocked due to spam filtering.
You can use it to enforce stricter behavior, for example:
- Always block spam-filtered submissions (discard them entirely)
- Conditionally block submissions for specific forms or specific request contexts (depending on how you implement your callback)
Example
/**
* Force WPForms to block spam-filtered submissions (discard entirely).
*
* @link https://wpforms.com/developers/wpforms_process_is_block_submission_by_spam_filtering_enabled/
*
* @param bool $enabled Whether blocking is enabled.
* @return bool
*/
add_filter( 'wpforms_process_is_block_submission_by_spam_filtering_enabled', '__return_true' );