Skip to main content

Embedding forms

Every form gets an auto-generated page, but forms can also be embedded in any page or post.

Auto-generated pages​

Saving a form creates (or updates) a WordPress page for it, nested under /forms/ by default. The page uses LocalForm's fullscreen template unless the form's Use site theme styling setting is on, in which case the active theme's page template is used.

The default parent slug can be changed with the localform_forms_base_slug filter (return '' for site-root pages).

Blocks​

LocalForm's blocks are grouped under a LocalForm category in the block inserter.

LocalForm​

Add the LocalForm block and pick a form from the dropdown - either in the placeholder, or from the Form panel in the sidebar once one is chosen. The editor renders the real form, exactly as the published page will, so there is no need to preview the page to see what you are laying out.

The block supports wide and full alignment, and the usual margin and padding controls.

LocalForm QR Code​

Add the LocalForm QR Code block to place a scannable code linking to a form's own page - handy for a printed flyer, a poster, or a slide at the end of a talk.

SettingWhat it does
FormThe form the code links to. It points at the form's own page, so the form needs to have one.
SizeThe code's width in pixels, between 96 and 480.
Show the form title below the codePrints the form's title as a caption under the code.

The code is generated on your own site - LocalForm never sends a form's URL to an outside QR service.

Shortcode​

[localform id="123"]
[localform slug="my-event"]

Use the form's ID (visible in the edit screen URL) or its slug.

Behavior notes​

  • Embedded forms render exactly like the auto-generated page: same fields, styling, AJAX submission, and registration-limit checks.
  • Draft forms are hidden from visitors; administrators see them with a draft notice, so embeds can be previewed before publishing.
  • Styles and scripts are only loaded on pages that actually contain a form.
  • A QR code block for a draft form, or for a form that has no page yet, renders nothing for visitors.

LocalForm Pro adds Prefill from URL on a per-question basis, plus a Copy prefill link button in the builder to generate the query string for you - see Prefill from URL.