Add a form to your WordPress website
Put an Open Leads form on any WordPress page, post, sidebar or footer: where to paste the code in the Block editor, Classic editor, Elementor, Divi and other page builders, and how to fix common problems.
On this page
Your Open Leads forms can sit right on your WordPress website, so every visitor who fills one in becomes a lead in Open Leads straight away. This guide shows exactly where to paste the form's code in WordPress, whichever editor or page builder your site uses, and how to fix the few things that can go wrong.
Step 1: Copy your form's code
- In Open Leads, open Forms and click the form you want on your site.
- Open the Share tab.
- In the Using WordPress? box, click Copy. That copies the form's embed code.
The form must be public. A private form has no public link, so it can't go on a website. Turn on public access in the form's Settings tab. Update forms are sent to leads by email instead, so they don't have embed code.
Step 2: Paste it into WordPress
Sign in to WordPress as an Administrator. WordPress only lets administrators save embed code. If you are signed in as an Editor or Author, the code is quietly removed when you save. Then follow the steps for the editor your site uses.
Block editor (the standard WordPress editor)
- Open the page or post, and click where the form should go.
- Click the + button, search for Custom HTML, and add that block.
- Paste the code into the block.
- Click Preview in the block's toolbar to see the form, then click Update (or Publish).
Classic editor
- Open the page or post and switch the editor to the Text tab. Don't use the Visual tab, which turns the code into plain words.
- Paste the code where the form should go, then click Update.
Elementor
- Edit the page with Elementor and drag the HTML widget onto the page.
- Paste the code into the widget's HTML Code box, then click Update.
Divi
- In the Divi Builder, add a Code module where the form should go.
- Paste the code into the module, save the module, then save the page.
Other page builders
Every page builder has a block for raw code. It's called Raw HTML in WPBakery, HTML in Beaver Builder, and Custom HTML or Code in most others. Add that block and paste the code into it.
Sidebar or footer
- Go to Appearance → Widgets (or Appearance → Editor on block themes).
- Add a Custom HTML widget or block to the sidebar or footer area, paste the code, and save.
Step 3: Make it fit
- If the bottom of the form is cut off, raise the number in
height="700"(for example toheight="950") until the whole form shows, including the submit button. - Once the whole form fits, you can change
scrolling="auto"toscrolling="no"to hide the scroll bars. - Check the page on a phone too. Phones need more height because the fields stack.
- To change colors and fonts so the form matches your site, use a form style. See Style my forms to match my website.
Rather link to the form?
You don't have to embed the form. Copy the form's link from the Link to this form box on the Share tab and use it as a button or menu link in WordPress. The form then opens on its own page.
Troubleshooting
| What you see | What to do |
|---|---|
| The code disappears after you save | Your WordPress user isn't an Administrator, or the site is a multisite network where only the network's Super Admin can save embed code. Ask your site administrator to paste it. |
| A blank box shows where the form should be | A security or "harden WordPress" plugin may be blocking embedded content. Allow embeds from openleads.com in that plugin's settings, then clear your site's cache. |
| The code shows on the page as text | It was pasted into a normal paragraph or the classic Visual tab. Delete it and paste it into a Custom HTML block (or the Text tab) instead. |
| Changes don't show on the live site | Clear the cache in your caching plugin or hosting dashboard, then reload the page. |
| The form doesn't go to my thank-you page after submitting | A redirect after submitting doesn't work for an embedded form. The visitor sees the form's own thank-you message instead. |
| You used the form source code and submissions don't arrive | A form hosted on your own site with the Form source code needs your website's domain listed under Spam protection in the form's Settings tab. Most WordPress users should use the embed code instead. |
Coming soon: the Open Leads WordPress plugin
We're building an Open Leads plugin for WordPress. With it, you'll add a form by picking it from a list or pasting a short code like [openleads_form id="123"], with no embed code to copy. When it's ready, it will appear in the Using WordPress? box on every form's Share tab.