WPForms Templates API

Form templates in a form plugin are a must-have feature. Customers love to save time by creating their forms starting from a template, instead of from scratch. But although WPForms was already one of the 10 most used WordPress plugins in 2021, it had just a few templates hard-coded in the plugin and no flexibility to create more.

So I received the mission to create a templates site, which should have also an API that would provide all the templates to the plugin. After getting the site layout from the design team on a Figma project, I developed alone both the site and the API using WordPress + WPForms. And it’s running smoothly since it was released in late 2021.

I used the plugin itself to let the content team create form templates with its amazing drag-and-drop functionality and use all the features the plugin offers. So the plugin creates the templates for itself. That way, we could easily publish the templates as posts for preview and search on the templates site, which is a very important tool for marketing and sales.

By using the plugin hooks, I could also fetch and export all the fields and settings of each template to power the API, which is made by some very slim WP calls, after all, it should handle millions of requests due to the plugin size. Each call has two jobs: check the user privileges and to confirm if they can fetch the template requested and provide the response accordingly.

This was a very fun and challenging implementation that required great performance, scalability and attention to detail. And I’m glad it went pretty well since its launch.

API CSS Javascript PHP wordpress WPForms