Here’s how Gravity Forms is structured within your database:
Note: This structure applies to Gravity Forms version 2.3 or higher.
Tables
Listed below, you can find the names and definitions for tables created by Gravity Forms. WordPress adds a prefix to any tables created, so when checking them in your database, you will notice all the tables have a prefix before their name. The user sets this prefix during WordPress installation, allowing it to be different for each installation.
gf_addon_feed
Contains Gravity Forms feeds.
| Column | Description |
|---|---|
id | Contains the unique feed ID. AUTO_INCREMENT must be enabled. |
form_id | Contains the ID of the form that the feed is associated with. |
is_active | Defines if the feed is active or not. Integer is used as a boolean (0 is false, 1 is true). |
feed_order | The order in which the feed is processed if multiple feeds exist. |
meta | Meta information related to the feed. Stored as JSON. |
addon_slug | The slug of the add-on that the feed is associated with. |
gf_addon_payment_callback
Contains information related to payment callbacks that have been received.
| Column | Description |
|---|---|
id | The row ID. AUTO_INCREMENT must be enabled. |
lead_id | The entry ID associated with the callback. |
addon_slug | The add-on associated with the callback. |
callback_id | The callback ID. |
date_created | The date that the callback was received. |
gf_addon_payment_transaction
Contains transaction details.
| Column | Description |
|---|---|
id | The transaction ID. AUTO_INCREMENT must be enabled. |
lead_id | The entry ID associated with the transaction. |
transaction_type | The transaction type. |
transaction_id | The unique transaction ID. |
subscription_id | The subscription ID, if applicable. |
is_recurring | Defines if this is a recurring subscription. Integer is used as a boolean (0 is false, 1 is true). |
amount | The amount of the transaction. |
date_created | The date the transaction was created. |
gf_draft_submissions
Holds draft submissions created by the save and continue feature.
| Column | Description |
|---|---|
uuid | The unique ID of the draft submission. |
email | The email address associated with the draft submission. |
form_id | The form ID that the draft submission is associated with. |
date_created | The date the draft submission was created. |
ip | The IP address that created the draft submission. |
source_url | The URL that was used to submit the draft submission. |
submission | Submission details regarding the draft submission. |
gf_entry
Contains Gravity Forms entries.
| Column | Description |
|---|---|
id | The unique entry ID. AUTO_INCREMENT must be enabled. |
form_id | The form ID that the entry is associated with. |
post_id | The ID of the post that was created from the entry, if applicable. |
date_created | The date that the entry was created. |
date_updated | The date that the entry was last updated. |
is_starred | If the entry is starred. Integer is used as a boolean (0 is false, 1 is true). |
is_read | If the entry has been marked as read. Integer is used as a boolean (0 is false, 1 is true). |
ip | The IP address that submitted the entry. |
source_url | The URL of where the submission took place. |
user_agent | The user agent of the entry submitter. |
currency | The currency used in the entry, if applicable. |
payment_status | The status of the payment, if applicable. |
payment_date | The date that the payment took place, if applicable. |
payment_amount | The amount of the payment, if applicable. |
payment_method | The transaction method used to process the payment, if applicable. |
transaction_id | The transaction ID associated with the entry, if applicable. |
is_fulfilled | If the transaction has been fulfilled, if applicable. |
created_by | The ID of the user that created the entry, if applicable. |
transaction_type | The transaction type, if applicable. |
status | The current entry status. |
source_id | Null or the ID of the post or page where the form was embedded at the time the entry was saved. Since Gravity Forms 2.9. |
gf_entry_meta
Contains additional metadata related to entries. Details from fields, as well as add-ons, are stored here.
| Column | Description |
|---|---|
id | The unique ID. AUTO_INCREMENT must be enabled. |
form_id | The form ID that the entry meta is associated with. |
entry_id | The entry ID that the meta is associated with. |
meta_key | The meta key. |
meta_value | The value stored under the meta key. |
item_index | The item index. |
gf_entry_notes
Contains notes that were placed on an entry.
| Column | Description |
|---|---|
id | The note ID. AUTO_INCREMENT must be enabled. |
entry_id | The entry ID that the note is associated with. |
user_name | The user name that created the note. |
user_id | The user ID that created the note. |
date_created | The date that the note was created. |
value | The contents of the note. |
note_type | The type of note that was left, if applicable. |
sub_type | The secondary note type, if applicable. |
gf_form
Contains the forms that exist within Gravity Forms.
| Column | Description |
|---|---|
id | The form ID. AUTO_INCREMENT must be enabled. |
title | The form title. |
date_created | The date that the form was created. |
is_active | If the form is active. Integer is used as a boolean (0 is false, 1 is true). |
is_trash | If the form is trashed. Integer is used as a boolean (0 is false, 1 is true). |
gf_form_meta
Contains metadata associated with forms.
| Column | Description |
|---|---|
form_id | The form ID that the metadata is associated with. |
display_meta | Meta related to how the form and fields are configured. |
entries_grid_meta | Additional meta related to entries and how they will be displayed. |
confirmations | Confirmation configuration. |
notifications | Notification configuration. |
gf_form_revisions
Contains form revisions. At the time of writing, this documentation is only used for Consent fields.
| Column | Description |
|---|---|
id | The ID. AUTO_INCREMENT must be enabled. |
form_id | The form ID that the form revision is associated with. |
display_meta | Meta related to how the form and fields are configured. |
date_created | The date that the revision was created. |
gf_form_view
Contains details on form views.
| Column | Description |
|---|---|
id | The ID. AUTO_INCREMENT must be enabled. |
form_id | The form ID that the data is associated with. |
date_created | The date that the row was created. |
ip | The IP that accessed the form. |
count | The number of times that the IP accessed the form. |
Changes from Gravity Forms 2.2
Introduction
The database schema was updated in Gravity Forms 2.3 to enable significant performance enhancements and to accommodate key feature additions. Code that uses the Gravity Forms API (GFAPI) will not be affected and will continue to work as before. However, custom code and add-ons that access the database tables directly will need to be updated.
Changes
The following changes were made to the tables and columns.
- rg_lead -> gf_entry
- rg_lead_details + rg_lead_meta tables -> gf_entry_meta
- All lead_id columns -> entry_id
- rg_form -> gf_form
- rg_form_view -> gf_form_view
- rg_form_meta -> gf_form_meta
- rg_incomplete_submissions -> gf_draft_submissions
Note: Despite of tables gf_addon_feed, gf_addon_payment_callback and gf_addon_payment_transaction are using the gf_ prefix, they’re not part of the changes done in this version. If for any reason you need to delete the new tables to run the upgrade from scratch again, make sure to skip these tables.
The Migration Process
The automatic migration process creates new tables and copies all the data into them in a series of background tasks. If the task stops, for example, due to a server restart, the migration will continue with a scheduled cron task. If a database error occurs, the migration will stop and attempt to retry later.