Docs

WPForms Integration

3 min readUpdated June 22, 2026

WPForms is one of the most popular WordPress form builders, known for its drag-and-drop editor and broad add-on ecosystem. WP Smart Consent integrates with WPForms to add an opt-in checkbox to any form, with per-form configuration accessible directly inside the WPForms form builder.

Enabling the Integration#

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

A settings page for WPForms shows the plugin as "Inactive." Tabs for "General" and "Collect fields" are visible. The option "Enable WPForms" is off. A note explains how to enable consent mode, and a green "Save WPForms" button appears at the bottom.

Per-Form Settings#

WP Smart Consent adds a WP Smart Consent panel to the WPForms drag-and-drop builder. To access it, open any form in WPForms → All Forms → Edit and click the WP Smart Consent button in the builder’s top navigation panel row. Settings are saved via AJAX and stored as post meta on the wpforms post type.

Form Type#

Contact form — WP Smart Consent injects the consent checkbox via wpforms_display_submit_before, which fires immediately before the WPForms submit button. The checkbox uses the name wpforms[wpsc_optin] so WPForms’ own form serializer includes it inside $_POST['wpforms'], making the value available as $entry['wpsc_optin'] at submission time — no separate POST key lookup needed.

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. WPForms identifies fields by their integer field ID. Simple fields use the numeric ID directly (e.g. 3). Name fields that split into first, middle, and last use a compound key format — {id}:first and {id}:last — which appear as separate entries in the dropdown. The dropdown is populated automatically from the form’s registered fields.

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

Extra Fields#

Below the standard field selectors, the Extra fields section lets you map any additional WPForms 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 listens on wpforms_process_complete, which fires after every successful WPForms submission and entry save. The $fields array passed by this hook is keyed by integer field ID and includes both the formatted value and sub-field values for compound fields like Name. Only validated, successfully saved submissions trigger consent capture — failed validations and spam-blocked submissions never reach this hook.

Troubleshooting#

WP Smart Consent panel not visible in the builder — confirm the WPForms integration is enabled in the WPSC dashboard. The panel button is added via wpforms_builder_panel_buttons and the panel body via wpforms_builder_panels. If the builder does not show the button, try refreshing the page after enabling the integration.

Checkbox not appearing on the form — confirm the form is enabled in its WP Smart Consent panel. The checkbox is injected via wpforms_display_submit_before. If another plugin or WPForms add-on hooks the same action at a lower priority and replaces the submit area, the checkbox may not appear.

Name field showing blank — WPForms name fields split into sub-fields with compound IDs. Ensure the dropdown selection uses {id}:first for first name and {id}:last for last name rather than the parent field ID, which returns a combined string that may not parse correctly.

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