How to publish a form built with Formidable
Once you have created a form, you may publish it on a page, post, View, or widget.
There are several simple ways to publish a form:
- Use the shortcode builder
- Insert the form shortcode manually
- Use a form block
- Use the Formidable Form widget to display a form in the sidebar
- Advanced users may also insert forms using PHP
Use the shortcode builder
- Go to a WordPress page or post.
- Click on the 'Formidable' button above the content box.
- Select the form to insert and choose from the options below
- Click the 'Insert into Post' button.
Insert the shortcode manually
You may insert the following shortcode on a page, post, or text widget to display your form.
Replace x with the id or key of your form. This id can be found by going into your form and looking in the upper right corner and then clicking 'Show'.
If you would like the form title or description to be displayed with the form, use the following shortcode.
[formidable id=x title="1" description="1"]
Please note, the title and description are NOT shown by default.
The following parameters may be used to customize your published form.
- id - ID or key of the form to publish. Using the key on a WP multisite install can by useful when copying a form from the main site to other sites. The key is copied, but the ids may differ from blog to blog.
- title - Show the form title with your form.
[formidable id=x title="1"]
- description - Show the form description with your form.
[formidable id=x description="1"]
- minimize - Minimize your form HTML. This will remove extra white space in your form HTML that is added if your form is double-filtered by another plugin or your theme.
[formidable id=x minimize="1"]
- entry_id - Specify an entry to edit. This can be a specific entry ID or entry_id=last to edit the most recent entry. Editing must also be enabled for this form and allowed for this user in the form settings.
[formidable id=x entry_id=y]
- readonly - Allow editing of all read-only fields.
[formidable id=x readonly=disabled]
- fields - Specify which fields to include in your form. Use a comma-separated list of field keys or ids.
[formidable id=x fields="field1,field2,field3"]
- exclude_fields - Exclude specific fields from your form. Use a comma-separated list of field keys or ids.
[formidable id=x exclude_fields="field1,field2,field3"]
- parameter - Pass a value to the form. When you pass a parameter to a form, you can use [get param="my_param"] to automatically populate a field.
[formidable id=x my_param="value"]
Use a form block
The WordPress block editor gives you alternate ways of publishing a form. Please see how to add a form block.
Formidable Form widget
You may use the 'Formidable Form' widget to add a form to your sidebar.
- In your WordPress dashboard, go to 'Appearance' → 'Widgets'.
- Drag the widget called 'Formidable Form' into your sidebar.
- Enter a Title for the widget (defaults to the form title if left empty).
- Select a Form to display.
- Select Show Description if you would like the form description to be displayed.
- Save your widget.
Form preview page
The form link to the preview page is publicly available, and works the same way as a form published on the page. Link to the preview page for a form landing page without the theme header and footer. This works great for surveys and polls.
Multiple forms on one page
As long as you are publishing different forms, it is no problem to have multiple forms on one page. But we do not recommend publishing the same form multiple times on one page. Each form and field has a unique HTML ID. You will get duplicate ID warnings if you have the same form published multiple times on a page.
If you would like to insert a form into your page template, use this PHP:
echo FrmFormsController::show_form(x, $key = '', $title=true, $description=true);
If you need more options, you may use this code instead:
echo FrmFormsController::get_form_shortcode(array('id' => x, 'title' => false, 'description' => false, 'readonly' => false, 'entry_id' => false, 'fields' => 'field1,field2,field3'));
Replace ‘x’ with the form id. All shortcode parameters can be used in the PHP call as well.
Slow form submission
Some sites may see a long delay after the form is submitted. This means some action triggered after submit is causing a slow down.
The most common reason we see for this is related to slow PHP emails from web servers. To check if this is the case, add a line of conditional logic to your email settings that will never be true. Then try to submit the form again. If this solves the speed issue, install an SMTP plugin to avoid using your webhost email servers.
If the form submission is slow when no emails are being triggered, disable any custom code that is fired after form submit, and add conditional logic to each form action in your form.
500 Internal Server Error after submission
This error is most often caused by a conflict with custom code or another plugin. The fastest way to find the source is to get the exact error message that tells you which line of code on your site is causing the problem. To get this error message, either check your PHP error logs, turn on WP_DEBUG mode, or contact your web host.
If you can't find the message, or the message isn't specific enough, follow the steps to find the source of a conflict.
Just like emails can cause a slow response, they can sometimes cause a 500 error as well. Follow the steps above to check if any form action has problems.
If the error continues after taking all the steps listed above, open a support ticket. Please include the exact error message so our team can help.
413 Request Entity Too Large
If you are updating a large form, you might see a 413 Request Entity Too Large error message. This error is most often caused by publishing a large form that has exceeded its allowed server configuration. To check if this is the case, follow the steps below:
- Increase the memory_limit and adjust the post_max_size in your php.ini file.
- Another possibility is caused by a conflict with custom code or another plugin. Follow these steps to find the source of the conflict.
- If the error persists after following all the steps listed above, please open a support ticket and include the exact error message.
It looks like you've already submitted that
This error message is most often caused by the following reasons:
- Conflict with custom code or another plugin
- Corrupted form database table
- Duplicate submissions being received
Conflict with custom code or another plugin
If you have custom code or another plugin that is interfering with Formidable, follow the steps to find the source of the conflict.
Corrupted form database table
If there are no entries being created in this form, contact your web host and ask them if your wp_frm_items and wp_frm_item_metas tables need to be repaired.
Duplicate submissions being received
If you are seeing this message when a duplicate entry is submitted, but you want to allow duplicate entries, you can trick the duplicate checker into not recognizing a duplicate.
- Add a hidden field to your form.
- Click the input field which will open the Default Values tab in the right sidebar.
- Click the Current Date and Current Time buttons to insert the [date][time] as the default values.