Create Form is a WordPress ability from Ninja Forms — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Create Form
WriteCreate a new Ninja Forms form, optionally with fields, actions, and calculations, in a single call.
Requires the Ninja Forms plugin on WordPress 6.9+ for the Abilities API (all 32 abilities are registered only when the wp_register_ability() function exists, via NF_Abilities_Integration::load_abilities_api() running on plugins_loaded). Every ability is gated by the same ninja_forms_ability_can_manage_forms() permission callback, requiring the caller to hold WordPress's manage_options capability or Ninja Forms' own nf_edit_forms capability.
What it does
This ability creates a brand-new Ninja Forms form from a title plus an optional array of field definitions, custom actions, and calculator formulas. If no actions are supplied, Ninja Forms automatically attaches its three default actions — Success Message, Admin Email, and Record Submission — so submissions are saved to the database without any extra setup. The form comes back with a form_id that ninjaforms/add-field can then use to keep adding fields, and a submit button is always appended automatically. This lets an AI assistant scaffold an entire form — including calculator logic and merge-tag-driven success messages — from a single natural-language request instead of the user clicking through the drag-and-drop builder field by field.
See it in action
You ask your AI assistant
"Create an 'Event RSVP' form with a First Name, Last Name, Email (required), and a Yes/No/Maybe radio field for attendance, and set the success message to thank the guest by name."
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Form title. |
| fields | array | No | Field definitions to add during creation (type, label, required, placeholder, default_value, help_text, admin_label, key, options). |
| actions | array | No | Custom actions to attach; if omitted, default Success Message/Admin Email/Record Submission actions are added automatically. |
| show_title | boolean | No | Show the form title. Defaults to true. |
| form_title_heading_level | string | No | Heading level for the form title (1-6). Defaults to '3'. |
| default_label_pos | string | No | Default field label position: above, below, left, right, or hidden. Defaults to 'above'. |
| clear_complete | boolean | No | Clear the form after a successful submission. Defaults to true. |
| hide_complete | boolean | No | Hide the form after a successful submission. Defaults to true. |
| ajax_submit | boolean | No | Enable AJAX form submission. Defaults to true. |
| logged_in | boolean | No | Require the submitter to be logged in. Defaults to false. |
| not_logged_in_msg | string | No | Message shown when a logged-out user tries to submit a login-required form. |
| allow_public_link | boolean | No | Allow anonymous access via a public link. Defaults to false. |
| sub_limit_number | integer | No | Maximum number of submissions allowed. |
| sub_limit_msg | string | No | Message shown once the submission limit is reached. |
| wrapper_class | string | No | Custom CSS class for the form wrapper. |
| element_class | string | No | Custom CSS class for the form element. |
| calculations | array | No | Calculator formulas, each with a name and an eq equation using {field:key}/{calc:name} references. |
| currency | string | No | Currency code for payment/calculator forms. |
| conditions | array | No | Form-level conditional logic. |
| admin_email_to | string | No | Admin notification recipient (only used with default actions). Defaults to '{wp:admin_email}'. |
| admin_email_subject | string | No | Admin notification subject (only used with default actions). |
| success_message | string | No | Success message text (only used with default actions). |
| submit_label | string | No | Submit button label. Defaults to 'Submit'. |
| honeypot_enabled | boolean | No | Enable honeypot spam protection. |
Returns
An object with a 'success' boolean, the new form's 'form_id', a 'field_count' of how many fields were created, and a human-readable 'message'.
Permission
The current user must have WordPress's 'manage_options' capability or Ninja Forms' own 'nf_edit_forms' capability (checked via the shared ninja_forms_ability_can_manage_forms() permission callback).
More Ninja Forms abilities
Add Action
Add a post-submission action to a form — email, redirect, success message, or save.
Add Calculation
Add a calculator formula to a form for use in calc fields and conditional logic.
Add Field
Add a single field to an existing form, to be called once per field when building out a form.
Delete Action
Permanently delete an action from a form.
Delete Calculation
Permanently delete a calculation from a form.
Delete Form
Permanently delete a form and all of its fields, actions, and submissions.