Add Field 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 →Add Field
WriteAdd a single field to an existing form, to be called once per field when building out a form.
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 appends one field to a form identified by form_id, using the same field-definition shape as ninjaforms/create-form's fields array (type, label, required, placeholder, default_value, help_text). It's meant to be called repeatedly — once per field — after ninjaforms/create-form has established the form, letting an AI assistant build up a complex form incrementally: adding a name field, then an email field, then a star-rating field, and so on. Email, phone, and address-type fields should be flagged personally_identifiable for GDPR handling, and spam-protection fields like hCaptcha/reCAPTCHA are expected to be hidden and non-required rather than shown as normal form fields.
See it in action
You ask your AI assistant
"Add a required Email field to form 12, then add an optional Phone field right after it."
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| form_id | integer | Yes | Numeric ID of the form to add the field to. |
| type | string | Yes | Field type: one of textbox, textarea, email, number, checkbox, listcheckbox, listradio, listselect, listmultiselect, date, hidden, html, submit, firstname, lastname, phone, city, zip, country, address, starrating. |
| label | string | No | Field label. |
| required | boolean | No | Whether the field is required. Defaults to false. |
| placeholder | string | No | Placeholder text. |
| default_value | string | No | Default value. |
| help_text | string | No | Help text shown with the field. |
Returns
An object with a 'success' boolean, the new 'field_id', the 'form_id' it was added to, the field 'type', and a '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.
Create Form
Create a new Ninja Forms form, optionally with fields, actions, and calculations, in a single call.
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.