WordPress
Published: 27-Jul-2026

How to Create a Contact Form in WordPress Without a Plugin

Skip Contact Form 7 and WPForms. Embed a lightweight HTML form in a WordPress page or theme and route submissions to a cloud form backend — no plugin maintenance.

MFC

MyFormConnect Team

WordPress contact form plugins are convenient to install, but they accumulate quickly. Contact Form 7, WPForms, Gravity Forms — each adds admin screens, database tables, JavaScript on every page load, and another item on your update list. This guide shows how to add a working contact form to WordPress without any plugin, using a custom HTML block and an external form endpoint.

Why plugins cause problems over time

Form plugins like Contact Form 7, Gravity Forms, and WPForms earned their place — they made WordPress forms possible for millions of sites. They still work. The friction shows up later: plugin conflicts with page builders, caching, security suites, and other form add-ons; markup that fights your theme CSS; and upgrade scenarios where a WordPress, PHP, or plugin update breaks the form until someone patches it.

With MyFormConnect, there is no form-plugin update. Your HTML posts to an endpoint. Core, theme, and other plugins can upgrade without a matching form-plugin release. You also skip stacking extra plugins for spam detection, file storage, lead management, and integrations — that lives on the endpoint, and it is platform-agnostic, so the same setup works if the site is not WordPress next year.

Method 1: Custom HTML block in the block editor

This is the quickest approach and works without touching any theme files.

  1. In your WordPress admin, open the page where the form should appear
  2. Click the + button to add a block, and search for Custom HTML
  3. Paste the form HTML below into the block
  4. Update the page and test the form
<form action="https://myformconnect.io/f/YOUR_FORM_UUID" method="POST" class="contact-form">

  <p>
    <label for="cf-name">Name</label><br />
    <input id="cf-name" name="name" type="text" required style="width:100%; padding:0.5rem;" />
  </p>

  <p>
    <label for="cf-email">Email address</label><br />
    <input id="cf-email" name="email" type="email" required style="width:100%; padding:0.5rem;" />
  </p>

  <p>
    <label for="cf-message">Message</label><br />
    <textarea id="cf-message" name="message" rows="6" required style="width:100%; padding:0.5rem;"></textarea>
  </p>

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

</form>

The inline styles above are a starting point. Replace them with your theme's CSS classes once you've confirmed the form works. Set Redirect URL in form settings for a normal POST; with Ajax/fetch, handle success in your own JavaScript.

Method 2: Template part in a child theme

If you want the form to appear consistently across multiple pages, or you want it in a location the block editor doesn't reach (sidebar, footer), add it as a template part.

Create a file in your child theme at template-parts/contact-form.php:

<?php /* template-parts/contact-form.php */ ?>

<form action="https://myformconnect.io/f/YOUR_FORM_UUID" method="POST" class="contact-form">
  <label for="cf-name">Name</label>
  <input id="cf-name" name="name" type="text" required />

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

  <label for="cf-message">Message</label>
  <textarea id="cf-message" name="message" rows="6" required></textarea>

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

Set the thank-you page under Redirect URL in form settings (not a hidden field). With Ajax/fetch, handle success navigation in your own JavaScript.

Then include it in any template file with:

<?php get_template_part('template-parts/contact-form'); ?>

Always use a child theme — changes to a parent theme are overwritten on updates.

Method 3: Page builder HTML widget

If you're using Elementor, Divi, Bricks, or a similar builder, look for an HTML or Raw HTML widget. Paste the form HTML directly. The builder treats it as a custom code block and renders it without modification.

Styling the form to match your theme

Rather than inline styles, use your theme's existing CSS classes. Most WordPress themes style <input>, <textarea>, and <button> elements globally. If the default styling doesn't fit, add a class to the form and write targeted CSS in your child theme's style.css or via Appearance → Customise → Additional CSS.

Spam protection without Akismet

Akismet (the default WordPress anti-spam plugin) works for comments, but doesn't protect external form endpoints. Enable spam protection in the MyFormConnect form settings instead — it applies honeypot, rate limiting, and content scoring checks at the endpoint level before a submission reaches your dashboard.

For high-traffic or public-facing forms, see how to stop contact form spam without a backend.

Is it worth removing the plugin?

Those older WordPress form plugins did real work. If one is installed, updated, and conflict-free, switching isn't urgent. MyFormConnect is for when you want more than a WordPress-only form plugin: spam protection, file storage, lead management, and integrations in one place — without another plugin on the update list — and a setup that still works if you leave WordPress later.

You keep full control of the form markup. There is no form-plugin upgrade cycle. Spam protection runs on the endpoint rather than a stack of WordPress add-ons.

Ready to collect form submissions?

Create a free MyFormConnect form endpoint and skip building your own backend.

Start Free Trial

No credit card required · 5-minute setup