Get Form Shortcode is a WordPress ability from SureForms — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.

Install Free Plugin →

Get Form Shortcode

Read-only
SureForms Forms sureforms/get-shortcode

Get the shortcode and Gutenberg block markup needed to embed a SureForms form.

Requires the SureForms plugin on WordPress 6.9+ (the Abilities API is gated behind function_exists('wp_register_ability'), so it degrades gracefully on WP 6.4-6.8). Abilities only register when the 'srfm_abilities_api' option is enabled in SureForms' AI settings, and every ability requires the current user to have the 'manage_options' capability. Abilities that create or modify data additionally require the 'srfm_abilities_api_edit' option to not be explicitly disabled; abilities that permanently delete data additionally require 'srfm_abilities_api_delete' to not be explicitly disabled.

What it does

This is a small, focused ability that returns just the two ways a SureForms form can be embedded: the classic shortcode ([sureforms id="N"]) and the raw Gutenberg block comment markup. It first validates that the form ID corresponds to an existing SureForms form. It's useful when an AI assistant needs to hand a user (or another tool) the embed code for a page or post without pulling the form's full field structure.

See it in action

You ask your AI assistant

"Give me the shortcode to embed form 17 on a page."

Inputs

Name Type Required Description
form_id integer Yes The ID of the form to get the shortcode for.

Returns

An object with form_id, the shortcode string, and the block_markup string.

Permission

Requires the 'manage_options' capability, and the 'srfm_abilities_api' master option must be enabled. This ability has no additional gate option.

Newsletter

The AI + WordPress space moves fast. Keep up.

New tools, workflow ideas, and product updates — be the first to know what's next.

No spam, unsubscribe anytime.