Database Structure

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.

ColumnDescription
idContains the unique feed ID. AUTO_INCREMENT must be enabled.
form_idContains the ID of the form that the feed is associated with.
is_activeDefines if the feed is active or not. Integer is used as a boolean (0 is false, 1 is true).
feed_orderThe order in which the feed is processed if multiple feeds exist.
metaMeta information related to the feed. Stored as JSON.
addon_slugThe 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.

ColumnDescription
idThe row ID. AUTO_INCREMENT must be enabled.
lead_idThe entry ID associated with the callback.
addon_slugThe add-on associated with the callback.
callback_idThe callback ID.
date_createdThe date that the callback was received.

gf_addon_payment_transaction

Contains transaction details.

ColumnDescription
idThe transaction ID. AUTO_INCREMENT must be enabled.
lead_idThe entry ID associated with the transaction.
transaction_typeThe transaction type.
transaction_idThe unique transaction ID.
subscription_idThe subscription ID, if applicable.
is_recurringDefines if this is a recurring subscription. Integer is used as a boolean (0 is false, 1 is true).
amountThe amount of the transaction.
date_createdThe date the transaction was created.

gf_draft_submissions

Holds draft submissions created by the save and continue feature.

ColumnDescription
uuidThe unique ID of the draft submission.
emailThe email address associated with the draft submission.
form_idThe form ID that the draft submission is associated with.
date_createdThe date the draft submission was created.
ipThe IP address that created the draft submission.
source_urlThe URL that was used to submit the draft submission.
submissionSubmission details regarding the draft submission.

gf_entry

Contains Gravity Forms entries.

ColumnDescription
idThe unique entry ID. AUTO_INCREMENT must be enabled.
form_idThe form ID that the entry is associated with.
post_idThe ID of the post that was created from the entry, if applicable.
date_createdThe date that the entry was created.
date_updatedThe date that the entry was last updated.
is_starredIf the entry is starred. Integer is used as a boolean (0 is false, 1 is true).
is_readIf the entry has been marked as read. Integer is used as a boolean (0 is false, 1 is true).
ipThe IP address that submitted the entry.
source_urlThe URL of where the submission took place.
user_agentThe user agent of the entry submitter.
currencyThe currency used in the entry, if applicable.
payment_statusThe status of the payment, if applicable.
payment_dateThe date that the payment took place, if applicable.
payment_amountThe amount of the payment, if applicable.
payment_methodThe transaction method used to process the payment, if applicable.
transaction_idThe transaction ID associated with the entry, if applicable.
is_fulfilledIf the transaction has been fulfilled, if applicable.
created_byThe ID of the user that created the entry, if applicable.
transaction_typeThe transaction type, if applicable.
statusThe current entry status.
source_idNull 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.

ColumnDescription
idThe unique ID. AUTO_INCREMENT must be enabled.
form_idThe form ID that the entry meta is associated with.
entry_idThe entry ID that the meta is associated with.
meta_keyThe meta key.
meta_valueThe value stored under the meta key.
item_indexThe item index.

gf_entry_notes

Contains notes that were placed on an entry.

ColumnDescription
idThe note ID. AUTO_INCREMENT must be enabled.
entry_idThe entry ID that the note is associated with.
user_nameThe user name that created the note.
user_idThe user ID that created the note.
date_createdThe date that the note was created.
valueThe contents of the note.
note_typeThe type of note that was left, if applicable.
sub_typeThe secondary note type, if applicable.

gf_form

Contains the forms that exist within Gravity Forms.

ColumnDescription
idThe form ID. AUTO_INCREMENT must be enabled.
titleThe form title.
date_createdThe date that the form was created.
is_activeIf the form is active. Integer is used as a boolean (0 is false, 1 is true).
is_trashIf the form is trashed. Integer is used as a boolean (0 is false, 1 is true).

gf_form_meta

Contains metadata associated with forms.

ColumnDescription
form_idThe form ID that the metadata is associated with.
display_metaMeta related to how the form and fields are configured.
entries_grid_metaAdditional meta related to entries and how they will be displayed.
confirmationsConfirmation configuration.
notificationsNotification configuration.

gf_form_revisions

Contains form revisions. At the time of writing, this documentation is only used for Consent fields.

ColumnDescription
idThe ID. AUTO_INCREMENT must be enabled.
form_idThe form ID that the form revision is associated with.
display_metaMeta related to how the form and fields are configured.
date_createdThe date that the revision was created.

gf_form_view

Contains details on form views.

ColumnDescription
idThe ID. AUTO_INCREMENT must be enabled.
form_idThe form ID that the data is associated with.
date_createdThe date that the row was created.
ipThe IP that accessed the form.
countThe 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.