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

Start free trial

Get Contact Form Shortcode

A Contact Form 7 form is not a page and has no URL. It appears in exactly one place: wherever its shortcode has been pasted.

contact-form-7/get-form-shortcode returns that string for a given form id. It is the last step of creating a form and the first thing to check when a form “does not appear on the site”.

At a glance

Abilitycontact-form-7/get-form-shortcode
ToolsetContact Form 7 — toolset/contact-form-7
GroupContact Form 7 › Forms
RequiresContact Form 7, active on the site
Capabilitymanage_options, plus read_contact_forms
SafetyRead-only — changes nothing
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

The shortcode carries both the form’s hash and its title. Contact Form 7 matches on the hash, so a shortcode keeps working after the form is renamed even though the title inside it goes stale.

Insert the result into a post with the content abilities, or hand it to someone to paste into a page builder.

Going the other way — shortcode in hand, wanting the form — is contact-form-7/find-form with the hash.

Input

NameTypeRequiredWhat it is
form_idintegerYesForm post ID, as returned by contact-form-7/list-forms.

What comes back

NameTypeWhat it is
form_idintegerThe form the shortcode belongs to.
shortcodestringThe shortcode string, ready to paste.
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:

Give me the shortcode for form 42 so I can drop it on the contact page.

It resolves to one call:

{
  "ability": "contact-form-7/get-form-shortcode",
  "parameters": {
    "form_id": 42
  }
}

Worth knowing

  • A form nobody can see is usually a form whose shortcode was never placed, not a broken form.
  • The title inside the shortcode is cosmetic. Contact Form 7 matches on the hash.
  • Page builders sometimes have their own Contact Form 7 widget. The shortcode works in all of them, but the widget may be the tidier option.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading