Docs

Ninja Forms Integration

4 min readUpdated July 4, 2026

Ninja Forms is a WordPress form builder with a Backbone/Marionette-based frontend. Because Ninja Forms renders its submit button via JavaScript rather than PHP templates, WP Smart Consent uses a script-based injection approach for the consent checkbox.

Enabling the Integration#

In the WP Smart Consent dashboard, go to Form Sources and toggle Ninja Forms on. Per-form behavior is then configured from the Ninja Forms settings page added by WP Smart Consent.

Screenshot of the "Ninja Forms" settings in a web interface. The section is inactive and shows tabs for "General" and "Collect fields." Options include enabling Ninja Forms and a green "Save Ninja Forms" button at the bottom.

Per-Form Settings#

WP Smart Consent integrates with Ninja Forms directly inside the form builder — there is no separate settings page. Each form is configured with two pieces, both added in the builder:

  • The WP Smart Consent field — a consent checkbox, added from the Fields drawer (under Miscellaneous Fields). Drag it onto the form wherever you want the consent box to appear. It is a standard Ninja Forms checkbox field, so it renders and submits through Ninja Forms’ own pipeline.
  • The WP Smart Consent action — added from the Emails & Actions tab (under Installed Add-on ActionsWP Smart Consent). The action holds all of the per-form configuration described below.

Open any form in Ninja Forms, add the field on the Form Fields tab and the action on the Emails & Actions tab, then configure the action.

Form Type#

Set on the WP Smart Consent action.

Contact form — the WP Smart Consent consent field (the checkbox you dragged onto the form) is the consent signal. The submission is forwarded only when that box is ticked. Because the checkbox is a native Ninja Forms field, it is serialized into Ninja Forms’ own submission payload like any other field — there is no injected markup and no extra POST parameter to preserve. The action identifies the consent field in the submission and reads its ticked / unticked state.

Newsletter form — no consent box is required. Every successful submission is treated as an opt-in and forwarded automatically.

Collect Fields#

Map the form’s fields to standard WPSC data fields on the action. Each mapping is a dropdown listing the form’s own fields (Ninja Forms’ native field picker). The dropdown stores the chosen field’s key; at submission time the action resolves that key to the submitted value from the submission data.

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 Ninja Forms 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.

CRM Overrides#

The CRM overrides section lets you override list/audience IDs and tags per CRM for this specific form. Enter the CRM slug (for example mailchimp, brevo, activecampaign, klaviyo, hubspot), the list IDs, and any tags. Separate multiple list IDs or tags with commas. Leave a CRM out to use that CRM’s global settings.

Submission Hook#

The WP Smart Consent action is a native Ninja Forms action. Its processing runs when Ninja Forms processes the form’s actions for a valid submission — after Ninja Forms has validated the entry, so it is effectively success-only. On each submission the action reads the consent field’s state, records the submission in the WP Smart Consent log, and, on genuine consent with a valid email, forwards the contact to your enabled CRMs, ESPs and webhooks.

Processing respects two switches: the global Ninja Forms integration toggle in the WP Smart Consent dashboard, and the per-action Enable WP Smart Consent toggle on the action itself. If either is off, the action does not log or forward.

Troubleshooting#

WP Smart Consent action not in the “Add new action” list — confirm the Ninja Forms integration is enabled in the WPSC dashboard and that Ninja Forms is active. When both are true, the action appears under Installed Add-on Actions in the Add-new-action drawer.

Nothing logged or forwarded — make sure both pieces are on the form: the WP Smart Consent field (the consent checkbox) on the Form Fields tab, and the WP Smart Consent action on the Emails & Actions tab, with the action’s Enable toggle on. In Contact mode the box must be ticked for the submission to be forwarded.

Consent value not captured — the consent field must be the WP Smart Consent field (not a plain checkbox). The action locates it in the submission automatically; if you replaced it with a different field, re-add the WP Smart Consent field from the Fields drawer.

Wrong field values forwarded — the action maps fields by dropdown selection. If a field was deleted and re-added in the form builder, its key changes. Re-open the WP Smart Consent action and re-select the correct fields.

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