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

Start free trial

Delete Contact Form

Contact Form 7 does not use the trash. Deleting a form removes it, both its mail templates, its messages and its settings immediately and permanently — there is no Restore link afterwards, because there is nowhere to restore it from.

There is a second consequence that is easy to miss: every page still containing that form’s shortcode now renders nothing at all. No error, no placeholder — the section of the page simply disappears.

Before you run it

This cannot be undone, and WordPress’s trash will not catch it. The call refuses without confirm: true. Run contact-form-7/duplicate-form first if there is any chance you will want the form back, and search your content for the shortcode before you delete the form it points at.

At a glance

Abilitycontact-form-7/delete-form
ToolsetContact Form 7 — toolset/contact-form-7
GroupContact Form 7 › Forms
RequiresContact Form 7, active on the site
Capabilitymanage_options, plus delete_contact_form
SafetyDestructive — deletes stored values, and refuses to run without confirm: true
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

The confirmation gate runs before anything is touched, so a call without confirm: true comes back with a typed error and an untouched site. That is what makes it safe to let an assistant propose the deletion and a human approve it.

Deleting an id that no longer exists reports the same result rather than failing, so the call is idempotent — a retry cannot delete something else by accident.

Duplicating first is the cheap insurance. contact-form-7/duplicate-form copies the template, both mail templates, the messages and the settings under a new title in one call.

Input

NameTypeRequiredWhat it is
form_idintegerYesForm post ID, as returned by contact-form-7/list-forms.
confirmbooleanYes — must be trueThe irreversibility gate. Without it the call is refused before anything is touched.

What comes back

NameTypeWhat it is
form_idintegerThe id that was deleted.
titlestringThe title of the form that was deleted, for the record.
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:

Delete form 61, the old newsletter signup — I have checked nothing links to it.

It resolves to one call:

{
  "ability": "contact-form-7/delete-form",
  "parameters": {
    "form_id": 61,
    "confirm": true
  }
}

Worth knowing

  • No trash, no revisions, no undo. The only backup is a copy you made first.
  • Pages holding the shortcode render nothing afterwards, silently.
  • Requires the delete_contact_form capability, which is narrower than the one the editing abilities use.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading