Advanced Forms + Custom Database Tables: how to store form entries in a custom table

Storing form entries in custom DB tables is a cinch when using the Advanced Forms plugin in combination with the ACF Custom Database Tables plugin provided you know how to connect the pieces.

Fortunately, all this can be done from within the WordPress admin so you don’t need any code snippets to make this work.

Step 1: enable entries on the form

First up, create your form and be sure to enable the create entries setting under Form Settings > Entries.

Step 2: Enable the field group on both the form and entries

Next, create a field group for your form fields and in the Location settings you want to have the following rules set up:

  • If post type is equal to Entry
  • OR form is equal to {your form}

This combination of rules allows the Advanced Forms plugin to map the field group to your form while also allowing the ACF Custom Database Tables plugin to map the field group to a database table.

Step 3: Manage your DB table as usual

In the ACF Custom Database Tables Settings box, enable the Manage Table Definition setting and specify your table name.

From this point, you just need to go through the normal table creation/update process and you’ll then have your form entry data storing to your custom table.

About the author

Phil Kurth is a web developer living in Melbourne, Australia. Phil has a long history of WordPress development and enjoys building tools to empower others in their web design/development practice.

When not working with the web, Phil is usually spending time with his two young sons or is out hiking through the Australian bush.

Good dev stuff, delivered.

Product news, tips, and other cool things we make.

We never share your data. Read our Privacy Policy

© 2016 – 2024 Hookturn Digital. All rights reserved.