When taking your WordPress site static, one of the most common changes you’ll need to make are getting your contact forms working.
Most contact forms for WordPress, whether installed via a plugin or included with your theme or pagebuilder, are dependent on server-side code for submitting the form data. The client (the user’s browser) submits the form data to a PHP script, which handles the mailing, via your own server or using a service such as MailGun, SendGrid, Postmark, etc.
Not having these server side scripts available is part of the security & performance benefits of going static. But it means we need somewhere else to post our form data. Luckily, we have a multitude of options.
Thanks to the WP Serverless Forms plugin, enabling any Contact Form 7 form to work is as simple as entering one line into the plugin’s settings.
After installing WP Serverless Forms, go to Settings > WP Serverless Forms in your WP admin dashboard and enter your custom “endpoint”. This is just a URL provided by a hosted form submission or API service, such as Basin, FormSpree, FormKeep, IFTTH or Zapier. You then manage how these forms are delivered to you and how users are redirected via their site.
If you’re using Netlify to host your static site, the process to convert an existing contact form to work on Netlify is also quite simple.
From their Forms documentation:
Code an HTML form into any page on your site, add a netlify attribute or data-netlify="true” to the
tag, and you can start receiving submissions in your Netlify site admin panel.
As with any embeddable content, like a map or social media feed, embeddable contact forms work just the same on your static site as they do in a regular WordPress site.
Searching for “embeddable contact form” will yield plenty of results to review, with different prices and features, such as Google Forms, Kontact and Cognito Forms.
There is also the purely JS + API email form service, EmailJS, which can connect to common transactional email providers.
For those wanting to keep everything under their own control, deploying a form handling script on your own servers or at least your own cloud instances offers more privacy protection. Whether a custom script or something like Formplug for AWS Lambda, you can have greater control over your data.
You don’t have to use a contact form on your site. A simple mailto link is still a valid option and you can even improve the UX a bit by pre-filling the message subject and body:
Back to top