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.
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: