30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Update Contact Form Field

contact-form-7/update-form-field rewrites a single tag. The surrounding markup, the labels and every other field are left byte for byte as they were, which is what makes it safe to run against a hand-crafted template.

You can change the type, the required flag, the options and the choices. You cannot change the name — and that omission is deliberate.

At a glance

Abilitycontact-form-7/update-form-field
ToolsetContact Form 7 — toolset/contact-form-7
GroupContact Form 7 › Fields & Template
RequiresContact Form 7, active on the site
Capabilitymanage_options, plus edit_contact_forms
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

Why you cannot rename a field here

A field name is not private to the template. It is also the mail tag, and it may appear in either mail body, in a subject line, or in the additional settings.

A rename that updates the template and leaves those behind produces a form that still submits, still reports success, and still sends a notification — with a blank line where the value used to be. Nothing in the WordPress admin flags it.

So renaming is a two-step operation you do knowingly: remove the field, add it under the new name, then run contact-form-7/validate-mail-tags and fix whatever it reports.

Input

NameTypeRequiredWhat it is
form_idintegerYesForm post ID, as returned by contact-form-7/list-forms.
namestringYesName of the field to change. Not itself changeable.
typestringNoNew field type.
requiredbooleanNoWhether the field is required.
optionsarray of stringsNoTag options, e.g. class:wide, id:enquiry-phone or maxlength:40. Write each as key:value; a value containing spaces is quoted for you, and one with a space but no key is refused.
valuesarray of stringsNoReplacement choices for a select or radio field.

What comes back

NameTypeWhat it is
form_idintegerThe form that was written.
fieldobjectThe field as parsed back out of the template.
tagstringThe rewritten tag.
templatestringThe template after the change.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Make the phone field on form 42 optional instead of required.

It resolves to one call:

{
  "ability": "contact-form-7/update-form-field",
  "parameters": {
    "form_id": 42,
    "name": "your-phone",
    "required": false
  }
}

Worth knowing

  • Idempotent — applying the same change twice leaves the same tag.
  • Only the named tag is touched. Labels and surrounding HTML are preserved exactly.
  • To rename: remove, re-add, then validate the mail tags. There is no safe one-step rename.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading