Core Forms
WordPress forms with payments, digital products and spam protection.
Core Forms provides six layers of spam protection that can be used individually or combined. Spam submissions are stored in the database (marked as spam) but do not trigger any actions.

A hidden field that legitimate users never see or fill in. Bots that auto-fill all fields will be caught. This is enabled by default on all forms with no configuration required. You can turn it off per form under Settings > Anti-spam > Honeypot field, for example when a custom integration submits the form without filling every field.
The honeypot field is rendered inside the form automatically and hidden with CSS. If it contains a value on submission, the submission is flagged as spam.
Invisible score-based CAPTCHA that runs in the background without user interaction.
Setup:
You can set both keys in wp-config.php instead with CORE_FORMS_RECAPTCHA_SITE_KEY and CORE_FORMS_RECAPTCHA_SECRET_KEY. The fields then show as set in wp-config.php. See Keys in wp-config.php.
reCAPTCHA is automatically added to all forms once both keys are saved. It evaluates user behavior and assigns a score (0.0 to 1.0). Scores below the threshold are flagged as spam.
// The reCAPTCHA integration hooks into form validation
add_filter( 'cf_validate_form', [ $recaptcha, 'validate_recaptcha' ], 10, 3 );
// And adds the reCAPTCHA widget to form markup
add_filter( 'cf_form_markup', [ $recaptcha, 'add_recaptcha_to_form' ], 10, 2 );
// And enqueues the script when a form is rendered
add_filter( 'cf_form_html', [ $recaptcha, 'enqueue_recaptcha_on_form_render' ], 10, 2 );
A privacy-focused CAPTCHA alternative from Cloudflare. Presents a simple widget that verifies users without puzzles.
Setup:
The keys can also live in wp-config.php as CORE_FORMS_TURNSTILE_SITE_KEY and CORE_FORMS_TURNSTILE_SECRET_KEY, or as the shared GT_TURNSTILE_SITE_KEY and GT_TURNSTILE_SECRET_KEY that other Gatilab plugins such as Core Bookings read too. You still tick Enable Turnstile on each form. See Keys in wp-config.php.
To try it on a staging site, Cloudflare publishes test keys that always pass: site key 1x00000000000000000000AA and secret key 1x0000000000000000000000000000000AA. The widget then shows “For testing only”. Never use them on a live site.
add_filter( 'cf_validate_form', [ $turnstile, 'validate_turnstile' ], 10, 3 );
add_filter( 'cf_form_markup', [ $turnstile, 'add_turnstile_to_form' ], 10, 2 );
add_filter( 'cf_form_html', [ $turnstile, 'enqueue_turnstile_on_form_render' ], 10, 2 );
Leverages the Akismet anti-spam service (requires the Akismet plugin to be installed and configured). Turn on the Akismet module under Core Forms > Modules (off by default). Keywords that should always skip Akismet go in Core Forms > Settings > Spam Protection > Akismet Whitelist.
Akismet checks submission content against its global spam database. It runs at a lower priority (20) so it executes after CAPTCHA checks:
add_filter( 'cf_validate_form', [ $akismet, 'check_for_spam' ], 20, 3 );
A simple math question (e.g., “What is 3 + 7?”) that bots typically cannot solve. No external service required.
Setup: open the form, go to Settings > Anti-spam and tick Math Captcha, then save. The Math CAPTCHA module must be on under Core Forms > Modules (it is by default).
add_filter( 'cf_validate_form', [ $math, 'validate_math_captcha' ], 15, 3 );
add_filter( 'cf_form_markup', [ $math, 'add_math_captcha_to_form' ], 20, 2 );
Block submissions to every form that contain words you never want, or that mention domains you don’t trust. The blocklist runs on your own server, before reCAPTCHA, Turnstile and Akismet, so it costs no outside requests.
Setup:
Blocked Words match like this:
casino doesn’t block casinos.* to match part of a word: casino* blocks casino and casinos.crypto investment matches those words together.Blocked Domains match like this:
name@spam.com), in a link (https://spam.com/offer), or as plain text (visit spam.com).spam.com also blocks mail.spam.com.https://www.spam.com/path, @spam.com or *.spam.com. Each becomes spam.com.Every text answer in the submission is checked. Uploaded files aren’t.
When Blocked has two options:
| Option | What the visitor sees | What happens to the submission |
|---|---|---|
| Mark as spam (default) | The form’s normal success message | Saved as spam when the form saves submissions, and listed in the Spam view. No actions run. |
| Reject | The form’s Blocked content message | Never saved. No actions run. |
Rejecting tells a real person what went wrong so they can fix their answer. Marking as spam gives a bot nothing to learn from, and lets you review false positives later.
Each form has its own Blocked content message on its Messages tab. The default reads: “Your submission contains words or links that are not allowed. Please revise it and try again.”
Developers can adjust the lists per form, or log matches:
// Add words for one form only.
add_filter( 'cf_blocked_words', function ( $words, $form ) {
if ( 'job-application' === $form->slug ) {
$words[] = 'guaranteed income';
}
return $words;
}, 10, 2 );
// Domains use the same pattern.
add_filter( 'cf_blocked_domains', function ( $domains, $form ) {
return $domains;
}, 10, 2 );
// Fires when a submission matches. $match is the word or domain that matched.
add_action( 'cf_submission_blocked', function ( $match, $form, $data ) {
error_log( "Core Forms blocked a submission to {$form->slug}: {$match}" );
}, 10, 3 );
Spam checks run in priority order via the cf_validate_form filter:
| Priority | Check | Class |
|---|---|---|
| 8 | Global blocklist | Blocklist |
| 10 | reCAPTCHA v3 | Recaptcha |
| 10 | Cloudflare Turnstile | Turnstile |
| 15 | Math CAPTCHA | MathCaptcha |
| 20 | Akismet | Akismet |
The honeypot is checked separately during form processing in Forms::process().
When a submission is flagged as spam:
is_spam flag is set to true on the submission.spam analytics event is recorded for reporting.Add your own spam checks using the cf_validate_form filter:
add_filter( 'cf_validate_form', function( $error_code, $form, $data ) {
// If another validator already flagged an error, pass through
if ( '' !== $error_code ) {
return $error_code;
}
// Block submissions with known spam phrases
$spam_phrases = [ 'buy now', 'click here', 'free offer' ];
$message = strtolower( $data['message'] ?? '' );
foreach ( $spam_phrases as $phrase ) {
if ( strpos( $message, $phrase ) !== false ) {
return 'spam';
}
}
return $error_code;
}, 25, 3 );
| Form Type | Recommended Protection |
|---|---|
| Contact form (low traffic) | Honeypot + Math CAPTCHA |
| Contact form (high traffic) | Honeypot + Turnstile or reCAPTCHA |
| Public-facing form | Honeypot + Turnstile + Akismet |
| Internal/logged-in form | Honeypot only |
Still stuck? Open a support ticket