Gravity Forms - WPDB Connect

Bluehost Shared Hosting

SP Gravity Forms WPDB Connect — Connect Gravity Forms directly to your WordPress (wpdb) Database

Write Gravity Forms entries into your own MySQL tables, fill field choices from SQL, and validate / look up field values against the database — all without leaving the standard Gravity Forms feed settings. No table builder, no bloat: this add-on simply maps your form to the database the way a developer would.

Whether you need a form to feed an existing CRM table, look up and validate a customer or order number against your own data, or fill a drop-down from a live SELECT, this add-on gives you a safe, fully integrated way to connect Gravity Forms to $wpdb — built on the official Feed Add-On Framework.

Why you’ll love it

  • Save entries to any WPDB table. Map each form field to a table column via the standard Gravity Forms feed settings — insert, update and delete.
  • Primary-key aware. Define a primary key so edits and deletions in the Gravity Forms backend are reflected in your table — the insert id is available as the {insert:id} placeholder.
  • Fill choices from SQL. Populate drop down, multi select, radio, checkbox and chained select fields directly from the database.
  • Fill pricing fields from SQL. Populate product, option and shipping fields, including the price.
  • Look-up & validate. Validate single line text / paragraph text (and more) against the database.
  • Read-only safety. Choices, look-up and validation queries are restricted to SELECT / SHOW — data is changed exclusively through the mapped feeds.
  • Full Gravity Forms integration. Built on the Feed Add-On Framework, with conditional logic, full GFAPI support and Chained Selects support.
  • Translatable. Text domain spgfwpdb; German translation included.

Key features

Save entries to any WPDB table

Add a WPDB Connect feed to a form (Form Settings → WPDB Connect → Add New) and map each form field to the column of any table in your WordPress database. Add a primary key so that editing or deleting the entry in the Gravity Forms backend updates or removes the matching row in your table. You can add multiple feeds to one form to write into several tables at once, and the auto-generated insert id is available as the {insert:id} placeholder.

Fill choices & pricing fields from SQL

Choice fields (drop down, multi select, radio, checkbox, chained select) and pricing fields (product, option, shipping) get an advanced field setting “MySQL-Query to fill the choices”. The result of your SELECT becomes the field’s choices — for pricing fields the price column is used as well. Already-defined static choices are kept and the query results are added.

Look-up & validate against the database

Input fields (single line text, paragraph text, number, name, email, …) get an advanced field setting “MySQL-Query to look-up your field”. The submitted value is validated against the result of your SELECT; if it does not match, the field shows a validation error.

Form-wide SQL validation

Define a SQL validation in the form settings that runs for the whole submission, so you can enforce database-level rules across several fields at once.

Merge-tag powered queries

Use standard Gravity Forms merge tags inside the choices, look-up and validation queries, so a query can depend on the values of other fields in the same submission.

Dynamic field support for developers

The form editor decides dynamically, from the registered field types, which fields get the choices setting and which get the look-up setting — so fields added by Gravity Forms core or by third-party plugins are supported automatically, with no extra configuration.

This is a developer tool: you write the SQL. The plugin gives you safe, integrated hooks to run it from within Gravity Forms.

How it works

  1. Add a WPDB Connect feed to your form and map the form fields to the columns of a database table (optionally with a primary key for updates/deletes).
  2. (optional) Give choice / pricing fields a choices query to fill their options from the database.
  3. (optional) Give input fields a look-up query to validate the value against the database.
  4. On submission the feed writes the row; edits/deletes in the entry list update/remove the row.

GFAPI & Chained Selects

  • GFAPI — entries created or updated through the Gravity Forms API also trigger the feeds (a helper class hooks gform_post_add_entry / gform_post_update_entry).
  • Chained Selects — the chained select field is supported both for saving and for pre-populating its levels from the database.

Supported fields

  • Standard: Single Line Text, Paragraph Text, Drop Down, Multi Select, Number, Checkbox, Radio
  • Advanced: Name, Date, Time, Phone, Address, Website, eMail, File Upload
  • Post: Title, Content, Excerpt, Tags, Category, Custom Fields, Image
  • Pricing: Product, Quantity, Option, Shipping, Total
  • Other: Chained Select, Credit Card

What’s included

  • The plugin (Feed Add-On + choices / look-up / form-validation settings).
  • English and German translations (text domain spgfwpdb).
  • Example SQL for sample tables.
  • Full documentation in English and German (README + feature overview).

Requirements & compatibility

  • WordPress 5.0+ (updated for 6.x / 7.0)
  • Gravity Forms 2.4+ (tested up to 2.10)
  • PHP 7.0+
  • SQL knowledge — this is a plugin for professionals and developers

Support & updates

Clean, well-documented code that’s easy to maintain. Localization-ready out of the box. Built to follow Gravity Forms’ official Feed Add-On Framework conventions, so it stays compatible as your stack evolves.

Changelog

4.0.2

  • Form-editor JS now assigns the choices / look-up settings dynamically from the registered field types (core & third-party).
  • Added developer STATUS notes.

4.0.1

  • Hardened the feed loops and the form-meta hook against PHP 8 undefined-key notices.
  • Chained-select input builder reads the field id array/object safely.

4.0.0 — 2026-06-19

  • Updated to WordPress 7.0.x.
  • Updated to Gravity Forms 2.10.x.
  • Cached the table and field information (one SHOW COLUMNS per table instead of one per field).
  • Removed a duplicate instantiation that caused the feeds to be processed twice.
  • The helper class now uses the correct add-on slug to retrieve its own feeds only.
  • The form object is now loaded before processing update/delete feeds (field values were not resolved).
  • The form is only re-saved in gform_pre_render when the choices have really changed.
  • The delete query in gform_delete_entries is now prepared.
  • Added a direct-access guard (ABSPATH) to all plugin files.
  • Removed the global error_reporting() calls that affected the whole site.
  • Look-up / choices / validation queries are now restricted to read-only statements (SELECT / SHOW).
  • Renamed a helper class to fix a typo.
  • Hardened the password handling and several uninitialized-variable notices.

3.9.0 — 2025-04-25

  • Updated to WordPress 6.8.
  • Updated to Gravity Forms 2.9.x.

3.8.0 — 2023-03-07

  • Updated to WordPress 6.1.
  • Updated to Gravity Forms 2.7.x.
  • Updated handling for type CHAR — values longer than the field length are now cut.
  • Updated handling for type FLOAT — the field value is converted to a number.
  • Added form validation against your WPDB database.

3.7.0 — 2022-10-10

  • Updated to WordPress 6.x.
  • Updated to Gravity Forms 2.6.x.

3.6.7 — 2020-05-02

  • Added support for gform_delete_lead.

3.6.6 — 2020-04-28

  • Fixed a problem with save and continue.

3.6.5 — 2020-03-07

  • Stripped SESSION coding.
  • Fixed some problems with foreach arrays.
  • Fixed a problem with nested shortcodes.
  • Fixed a problem with the GFAPI.
  • Fixed a problem with the password field.

3.5.1 — 2018-12-04

  • Fixed a problem with GF 2.4.

3.5.0 — 2018-11-02

  • Added conditional logic to process the feed.
  • Updated German translation.

3.4.1 — 2018-09-02

  • Changed choices handling.

3.4.0 — 2018-05-31

  • Updated to GF 2.3.
  • Updated to WP 4.9.
  • Added support for pre-populating chained select fields.
  • Added support to duplicate a feed.

3.3.0 — 2018-03-25

  • Added a dummy capability handling to support member plugins.
  • Added support for chained select fields.

3.2.4 — 2017-11-09

  • Fixed a bug when an entry is updated with the GFAPI.
  • Reload the entry from the database after it is saved to get the updated entry id for all following functions (notification, confirmation).
  • Already-given choices are now added to the choices from a SELECT.

3.2 — 2017-11-06

  • Use merge tags to perform the query to get choices.
  • Use merge tags to perform a look-up.
  • Hide multisite tables.

3.1 — 2017-03-01

  • Added support for “Full Name” values.
  • Added support for “Full Address” values.
  • Fixed empty values handling.
  • Added multiple value validating for Paragraph Text fields.
  • Added validating for number fields.
  • Fixed documentation.

3.0 — 2017-01-22

  • Updated to WordPress 4.7.x.
  • Updated to Gravity Forms 2.0.x.
  • Completely rewritten, based on the Gravity Forms Feed Add-On Framework.

2.9 — 2016-10-05

  • Updated to WordPress 4.6.x.
  • Updated to Gravity Forms 2.0.x.
  • Fixed a bug in the checkbox save routine.

2.7 — 2016-01-16

  • Bugfixing.

2.6 — 2016-01-10

  • Bugfixing.
  • New PHP file concept.

2.5 — 2016-01-05

  • Added support to create MySQL queries to fill the choices for product, option and shipping fields.
  • Added support to create MySQL queries to look up single line text and paragraph text fields against the database.

2.4 — 2015-12-27

  • Added support for pricing fields.

2.3 — 2015-12-17

  • Added support for post fields.

2.2 — 2015-11-22

  • Added support for name fields.
  • Added support for address fields.

2.1 — 2015-11-08

  • Use queries to fill in the choices for checkboxes, radio buttons, select boxes and multi-select boxes.
  • Added support for checkbox fields.
  • Added support for multi-select fields.

2.0 — 2015-09-26

  • Full code cleanup.
  • Stripped table-builder support — this is a plugin for professionals or developers.
  • Use of the new Gravity Forms API.
  • A lot of bugfixes.

1.2 — 2013-08-13

  • Better table handling.
  • Added support for the companion Gravity Forms List & Edit plugin — with it, already-saved MySQL entries can be listed and edited.

1.1 — 2013-01-11

  • Added default WordPress translation features, so the plugin is fully translatable.
  • German translation included.

3.9 average based on 26 ratings.

naranili

naranili

Visit Author's Portfolio

View Portfolio
Last Update 2026-07-01
Created 2013-10-29
Sales 845
Discussion Comments
Compatible Browsers
Software Version WordPress 7.0.x
Compatible With Gravity Forms
Gutenberg Optimized
High Resolution
Files Included JavaScript JS HTML CSS PHP
Video Preview Resolution
Search plugins
Browse Categories

Bluehost Shared Hosting