Deftform Logo

Deftform for WordPress

Embed beautiful forms in WordPress without a plugin

Build your form in Deftform, copy one snippet and paste it into any WordPress page. The form fits right into your layout, grows with every step and sends each response straight to your Deftform inbox. No plugin to install, update or secure.

  • First form free to try
  • No credit card required
  • Works with Gutenberg, Elementor and more

Embed code

Two lines of HTML are all WordPress needs

Every form in Deftform comes with a ready-made embed code. It loads your form into the page, matches the available width and keeps the height in sync with the content, so your visitors never see a second scrollbar.

Where to paste it

  • Gutenberg: Custom HTML block
  • Elementor: HTML widget
  • Divi: Code module
  • Classic editor: Text tab
  • Sidebar: Custom HTML widget
HTML
<div class="deftform"
     data-form-id="YOUR_FORM_ID"
     data-form-width="100%"
     data-form-align="center"
     data-form-auto-height="1"></div>
<script src="https://cdn.deftform.com/embed.js"></script>

Your own form ID is already filled in when you copy the code from your Deftform dashboard.

Step by step

Your form on WordPress in four steps

No developer, no plugin settings, no shortcodes. If you can copy and paste, you can embed a Deftform form.

  1. Build your form

    Create your form in Deftform with the drag-and-drop builder or let the AI assistant draft it for you. Add your logo and brand colors so it matches your site.

  2. Copy the embed code

    Open your forms list or the form builder and click "Copy embed code". Your form ID is already filled in.

  3. Paste it into WordPress

    Edit your page, add a Custom HTML block (or the HTML widget in Elementor) and paste the code.

  4. Publish the page

    Click Update or Publish. The form is live, adjusts its height automatically and every response lands in Deftform.

Auto height

The form grows with every step

Multi-step forms, conditional fields and error messages change the height of a form all the time. The Deftform embed resizes itself on the fly, so the page around it moves along naturally and there is never a cramped box or an inner scrollbar.

Responses

Responses go to Deftform, not into your WordPress database

Every submission is stored in your Deftform inbox. Get an email for new responses, send them to your tools with webhooks or export them whenever you need. Your WordPress site stays lean and has no form data to protect.

Beyond WordPress

Need a standalone form page as well?

The same form can also run on its own page under your own domain, with SSL included. Use the embed on your WordPress site and the direct link in newsletters, social posts or QR codes.

Why Deftform

Why WordPress sites use Deftform for their forms

Form plugins add settings pages, database tables and updates to look after. Deftform keeps all of that outside of WordPress.

No plugin to maintain

Nothing to install, nothing to update and no plugin conflicts after the next WordPress release. The embed code keeps working with any theme.

A leaner WordPress site

Responses, uploads and emails are handled by Deftform. Your WordPress database does not grow with every submission.

Fits every layout

The form takes the full width of its container and adjusts its height automatically, on desktop and on mobile.

Spam protection built in

Protect your forms with ALTCHA, Cloudflare Turnstile or reCAPTCHA. No extra anti-spam plugin required.

Connected to your tools

Send responses to your CRM or automation tools with webhooks and the HubSpot integration, without touching WordPress.

Made and hosted in Germany

Deftform is built in Germany and hosted in Falkenstein, so the data your visitors submit stays in the EU.

FAQ

Embedding forms in WordPress: frequently asked questions

Do I need a WordPress plugin to embed a Deftform form?
No. The embed code is plain HTML with a small script. Paste it into a Custom HTML block and your form is live. There is nothing to install or update.
Where do I paste the embed code in WordPress?
In the block editor (Gutenberg), add a Custom HTML block. In Elementor, use the HTML widget. In Divi, use the Code module. In the classic editor, switch to the Text tab. For sidebars and footers, use the Custom HTML widget.
Why does WordPress remove the embed code when I save?
WordPress only allows script tags for users with the "unfiltered_html" permission. On a normal site, administrators and editors have it. On a WordPress Multisite network, only Super Admins do. Ask someone with that permission to paste the code for you.
Does the embed work with caching and optimization plugins?
Yes. The embed code is static HTML, so page caching is no problem. If your optimization plugin delays or combines JavaScript, exclude https://cdn.deftform.com/embed.js from these optimizations.
Can I embed several forms on the same page?
Yes. Add one div with its form ID for every form, and include the embed.js script tag only once on the page. The script loads all forms it finds.
Can I prefill form fields from WordPress?
Yes. Add the data-form-prefill attribute to the embed code and pass the values as URL parameters, for example a campaign name or a product the visitor is interested in.
Where are the responses stored?
All responses are stored in Deftform, on servers in Falkenstein, Germany. Nothing is saved in your WordPress database, so there is no form data to back up or protect on your site.

Your next WordPress form is one paste away

Build your form, copy the code and publish. Your first form is free to try, no credit card required.

Create a form — the first one is free to try.