send.webforms.toRead the docs →

Site builders and CMS

Add a contact form to WordPress

Contact Form 7 and its relatives each add database tables, an admin surface, an SMTP dependency and another plugin to keep patched. If all you need is a contact form, a Custom HTML block pointed at an endpoint does the job - no plugin, no wp_mail() deliverability problem, and no extra attack surface on your site.

Get an endpointRead the docs

Setup

  1. Copy your endpoint

    Create a form in the dashboard.

  2. Add a Custom HTML block

    Edit the page, add a Custom HTML block and paste the markup. Works in the block editor and in Elementor, Divi or any builder's HTML widget.

  3. Style it with your theme's classes

    The markup is plain HTML, so your theme's form styles apply automatically.

WordPress examples

Swap in your own endpoint and these run as-is.

Custom HTML block
<form action="https://send.webforms.to/wft_your_key" method="POST" class="wf-contact">
  <p>
    <label for="wf-name">Name</label>
    <input type="text" id="wf-name" name="name" required>
  </p>

  <p>
    <label for="wf-email">Email</label>
    <input type="email" id="wf-email" name="email" required>
  </p>

  <p>
    <label for="wf-message">Message</label>
    <textarea id="wf-message" name="message" rows="5" required></textarea>
  </p>

  <input type="hidden" name="_next" value="https://example.com/thank-you/">
  <input type="hidden" name="_subject" value="New enquiry from the website">
  <input type="text" name="_gotcha" tabindex="-1" autocomplete="off"
         style="position:absolute;left:-9999px" aria-hidden="true">

  <button type="submit">Send message</button>
</form>

Optional shortcode, if you would rather reuse the form across many pages.

functions.php
<?php

function wf_contact_form_shortcode() {
    ob_start();
    ?>
    <form action="https://send.webforms.to/wft_your_key" method="POST">
      <input type="text" name="name" required>
      <input type="email" name="email" required>
      <textarea name="message" rows="5" required></textarea>
      <input type="hidden" name="_next"
             value="<?php echo esc_url( home_url( '/thank-you/' ) ); ?>">
      <button type="submit">Send</button>
    </form>
    <?php
    return ob_get_clean();
}
add_shortcode( 'wf_contact', 'wf_contact_form_shortcode' );

// Use [wf_contact] in any post or page.

Worth knowing

WordPress form FAQ

Yes. A Custom HTML block with a form whose action points at your endpoint is all that is needed. No plugin, no database table, no PHP executed when someone submits.

Ready to wire up your WordPress form?

Free for 300 submissions a month. Endpoint in under a minute, no card required.

Start free