Create a form
6 min read
You need an administrator account and a plan that includes forms. Open WPM Fields › Forms, tab Forms, and click Add form (the same button is in the empty state). The editor screen is titled Add form; the save button is Create form (later Save changes).
The editor has up to five cards, from top to bottom. Their content depends on the kind of form.
Card 1: Form
Setting | Default | Notes |
|---|---|---|
Title (required) | empty | "For you; visitors do not see it." |
Key (required) | filled from the title | "Used in the shortcode. Filled in from the title until you edit it." Lowercase letters, numbers and underscores, 2 to 64 characters, starting with a letter. After creation it reads "The key can't be changed after the form is created." |
The form | Post (create or edit) | The kind: Post (create or edit), User profile, User registration, Data table entry. Changing the kind resets what does not apply (see below). |
Active | on | "When off, pages that show the form print nothing and it accepts no entries." |
After the form has been created the card also shows its shortcode, "Put this shortcode on a page, or add the "WPM Form" block:", with a copy button.
Switching the kind: to User registration sets Who can submit back to everyone; to User profile from "logged-in users" does too; to Data table entry clears the chosen field groups and fields; switching away from it clears the table.
Card 2: Fields (or Columns)
For post, profile and registration forms the card is Fields: "Choose the field groups whose fields the form shows. The values are saved to the post or user the form creates or edits, like on the edit screen."
- Tick the field groups to use. Their keys are shown beside the names. Order of the form = order in which you ticked them.
- Under each ticked group, every field has a checkbox. By default all usable fields are on. Untick the ones the form should leave out. At least one field must stay ticked.
- A group marked Inactive is switched off in its group settings. You can still tick it, but the form does not show its fields while the group is inactive.
- A group that has no location rule cannot store values per post or user. It is greyed out with the note "Needs a location rule to store values per post or user." Give it any location rule (the rule's content is not checked against the form; it only has to exist). See Location rules.
- Fields that cannot work in a public form carry the badge Not available in forms and cannot be ticked. The note under the list explains the limits (admin-only pickers, containers, uploads inside repeaters).
For a Data table entry form the card is Columns: "Choose the columns of the data table that the form shows. Each submission adds a row to the table." It lists the columns of the table you pick in card 3.
When you leave all fields of a group ticked, the form keeps no list and shows every usable field of the group, including fields you add to the group later. As soon as you untick one field, the form keeps an explicit list and new fields of the group are not added automatically.
If you have no field groups yet the card says No field groups yet. with a link Create a field group.
Card 3: kind-specific settings
Kind | Card title | Explained in |
|---|---|---|
Post (create or edit) | Posts | |
User profile | User profile | |
User registration | New accounts | |
Data table entry | Data table |
Card 4: Who can submit
Shown for every kind except User registration (registration is always open to visitors).
Setting | Options |
|---|---|
Submitters | Anyone, including visitors (post and entry forms; Every logged-in user for a profile form), Logged-in users (post and entry forms only), Users with a capability. |
Capability | Shown with Users with a capability. Help: "For example edit_posts or read." Enter a WordPress capability such as |
A profile form is always for logged-in users, whatever you choose. What visitors see when they may not use a form:
Situation | Message |
|---|---|
Not logged in, form needs login | "Please log in to use this form." with a Log in link that returns to the page. |
Logged in without the capability | "You are not allowed to use this form." |
Logged-in user on a registration form | "You are already logged in." |
Registration is off | "Registration is closed." |
Access is checked when the form is shown and again when it is submitted.
Card 5: After submitting
Setting | Default | Notes |
|---|---|---|
Success message | a default for the kind | "Leave empty for a short default message." Plain text. |
Redirect to | none | "Optional address on this site shown instead of the message." Must be an address on this site. |
Button label | fits the form | "Leave empty for a label that fits the form." Defaults are Submit, Save changes, Update profile, Create account. |
Email me about entries | off | "Sends a short email with a link to each new entry." |
Send to | site admin email | Shown when the switch is on. "Leave empty for the site's admin email address." |
Details are in Notifications, messages and redirects.
Save and use the form
- Click Create form. A toast says Form created. (Form saved. on later saves). Moving away with unsaved changes asks for confirmation.
- Put the form on a page with the shortcode or the WPM Form block (overview).
- Test it as a visitor in a private window.
Messages when saving
Message | What to do |
|---|---|
"The key must start with a letter and use 2-64 lowercase letters, numbers or underscores." | Fix the key. |
"This key is reserved. Choose another one." | Do not use |
"A form with this key already exists." | Pick another key. |
"The form title is required." | Enter a title. |
"The field group "x" does not exist." | A group was deleted; untick it. |
"The field "a.b" does not belong to a field group of this form." | A field outside the form's groups was picked. |
"Choose a public post type." | Post forms need a post type that is public (not Media). |
"Choose a role that cannot edit, publish or manage anything. Registration forms never give such roles." | Pick a safe role. |
"Registration forms are for visitors who are not logged in, so everyone must be allowed to submit them." | Registration forms cannot be limited. |
"Choose the data table the form adds rows to." | Entry forms need a table. |
"Entry forms take their fields from a data table, not from field groups." | Remove the field groups from an entry form. |
"The data table "x" does not exist." | The table was deleted. |
"The redirect URL must be an address on this site." | Use a link on your own domain. |
"Entry forms need a plan that includes data tables." | Only for an active entry form on a plan without data tables. |
Edit and delete
- Edit reopens the editor. The key cannot be changed. Existing posts and rows are not changed by editing a form.
- Inactive forms print nothing for visitors and refuse submissions; administrators see
This form is inactive, so visitors do not see it. Activate it under WPM Fields › Forms. - Delete removes the form definition only.
Still stuck? Contact support