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.
Setup
Copy your endpoint
Create a form in the dashboard.
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.
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.
<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.
<?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
- Nothing is written to your WordPress database, so submissions survive a site migration, a rollback or a hack.
- Because there is no plugin, there is no plugin to update and no PHP running on submit.
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.
wp_mail() uses PHP's mail() by default, which usually sends without SPF or DKIM alignment for your domain, from a shared host IP. Sending through an authenticated provider fixes deliverability and gives you a delivery log.
Yes. Use their HTML widget and paste the same markup.
Related guides
Ready to wire up your WordPress form?
Free for 300 submissions a month. Endpoint in under a minute, no card required.
Start free