Docs

SureForms Integration

3 min readUpdated June 22, 2026

SureForms is a Gutenberg-native WordPress form builder from the Brainstorm Force team. WP Smart Consent integrates with SureForms to add an opt-in checkbox to any SureForms form, with per-form configuration managed via a WordPress meta box in the form editor.

Enabling the Integration#

In the WP Smart Consent dashboard, go to Form Sources and toggle SureForms on. Per-form behavior is then configured individually inside each form’s editor.

Screenshot of the SureForms plugin interface. "Enable SureForms" is toggled on. Tabs for "General" and "Collect fields" appear, with instructions and a green "Save SureForms" button at the bottom. Status is shown as "Active" in the upper right.

Per-Form Settings#

SureForms forms are standard WordPress posts of the sureforms_form post type. WP Smart Consent adds a WP Smart Consent meta box to the SureForms form editor sidebar. Open any form in the SureForms editor to see the meta box with options for enabling the integration, setting the form type, and mapping fields.

Form Type#

Contact form — WP Smart Consent injects the consent checkbox above the SureForms submit button via the srfm_before_submit_button action hook. The checkbox uses the global opt-in label configured in General settings and respects WPML, Polylang, and the bundled language translations for multilingual sites. Only submissions where the visitor ticked the checkbox are forwarded to your CRM destinations.

Newsletter form — no checkbox is injected. Every successful submission is treated as an opt-in and forwarded automatically.

Collect Fields#

Map the form’s fields to standard WPSC data fields. SureForms fields are identified by their block_id attribute — a unique identifier assigned to each Gutenberg block when it is added to the form. The dropdown in the meta box is populated by parsing the form’s Gutenberg block content via parse_blocks() and walking the block tree, including inner blocks inside group and column wrappers.

Supported SureForms block types: srfm/email, srfm/input, srfm/phone, srfm/textarea, srfm/number, srfm/url, srfm/dropdown, srfm/address, srfm/checkbox, and srfm/gdpr. Field labels in the dropdown match the label attribute set in the block, falling back to the block’s schema default label if none is set.

Email — required. First name, Last name, Phone, Company, Country — all optional.

Extra Fields#

Below the standard field selectors in the meta box, the Extra fields section lets you map any additional SureForms field to a custom CRM key. Select the form field on the left and enter the CRM key on the right. That key is sent alongside the standard contact data on every opt-in.

Submission Hook#

WP Smart Consent hooks into the srfm_form_submission_response filter rather than the srfm_form_submit action. The filter passes the raw REST request params in addition to the processed label-keyed data, which is necessary because the wpsc_optin checkbox value never goes through SureForms’ own submission processor — its key does not match the srfm-{id}-{block}-lbl- pattern SureForms uses internally. The raw params are stashed alongside the processed submission data so both are available for field value lookups and consent state reading respectively.

Troubleshooting#

Meta box not appearing in the form editor — confirm the SureForms integration is enabled in the WPSC dashboard. The meta box is registered on the sureforms_form post type and should appear in the form editor sidebar. If it does not, check that SureForms is active and the form is being edited via the standard WordPress editor URL.

Checkbox not appearing on the form — confirm the form is enabled in the WP Smart Consent meta box and the form type is set to Contact. The checkbox is injected via srfm_before_submit_button. If a SureForms update changes this hook name, the checkbox will stop appearing.

Wrong field values forwarded — SureForms field dropdowns use the block’s block_id attribute. If a block was deleted and re-added in the editor, it receives a new block_id. Re-open the meta box and re-select the correct field from the dropdown.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only