🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 22, 2026

How to Save Gravity Forms Entries in Meta Box Custom Fields

GravityExtra
How to Save Gravity Forms Entries in Meta Box Custom Fields

Meta Box is one of the most popular ways to add custom fields to WordPress, and Gravity Forms is one of the most popular ways to collect information from visitors. Putting the two together sounds easy: a visitor fills in a form, and a post with all its custom fields appears. In practice it is a chore. Somebody has to type the key of every custom field, work out what shape each one wants, and keep it all working when a field is added. This guide shows a faster way, and explains what really happens behind a custom field so you can trust the result.

A front-end Gravity Forms edit form for a property listing, already filled with the values saved in the Meta Box custom fields of the post: price, type, extras, dates and the rows of the rooms list
The owner opens the edit form and every mapped field is filled from the Meta Box values of the post.

Why Mapping Custom Fields by Hand Goes Wrong

Most form add-ons that create posts treat a custom field as a name and a piece of text. You type the name, you choose a form field and the text is saved. That works for a headline or a phone number. It breaks for almost everything else Meta Box can do.

  • Choices. A checkbox list stores a list of option values. A form stores the label of what was ticked. If they differ by a letter, nothing is checked in the post editor.
  • Dates. A date field can keep its value as text in one format, as a timestamp, or in another save format. A form date may use yet another order of day and month.
  • Images and files. An image field does not store the picture. It stores the id of an attachment in the Media Library, and the file has to be in the library first.
  • Relationships. A post, user or taxonomy field stores ids, not names.
  • Repeated groups. A group of fields that can be cloned stores a whole list of rows in a single entry.

When the shape is wrong, the post editor shows an empty field, the theme prints nothing, or a query by that field finds no posts. The problem is quiet, so it is often found weeks later.

How Meta Box Stores a Value

Meta Box is careful about this, and that is what makes a proper integration possible. Every field type has its own rules, and the plugin offers one function that applies them for you: rwmb_set_meta. You give it the object id, the key of the field and the value you want, and it runs the field type processing, cleans the value with the sanitising rule of that type and saves it through the storage of the meta box. If the meta box keeps its values in a custom table instead of in post meta, the same call hands the value to the table.

Reading the definition of a meta box is just as simple. The plugin keeps a registry of every meta box and the settings of every field, including the options of a select, the date format, the post types that a relationship may point to and the taxonomy of a term field. An add-on can ask the registry which meta boxes belong to a post type and then offer exactly those fields, in the same order, with the same names. That is why a new custom field shows up in the feed the moment you add it to the meta box.

Set Up a Feed in Five Minutes

The Gravity Forms Meta Box Integration add-on is built on those two ideas: read the registry, write with rwmb_set_meta. Here is the whole setup for a property listing form.

  1. Create the form: a text field for the title, a number field for the price, a drop down for the type, checkboxes for the extras, a date field, a List field for the rooms and a File Upload field for the photos.
  2. Open the form settings, choose Meta Box and add a feed. Choose the action to create a post and the post type of your listings. The feed reloads and shows a section for each meta box of that type.
  3. Choose the status. Draft is a good start while you test, because you can read each listing before it goes live.
  4. Pick a form field for each custom field. The hint below each drop down tells you what that field type expects.
  5. Send a test entry and open it. The note tells you what was created and what was skipped, and a link opens the new post.
The Meta Box feed settings of a Gravity Forms form: the post to create with its post type, status, author, title, featured image and taxonomy, then one section per Meta Box meta box with a drop down for every custom field, including the cloneable Rooms group
The feed of one form: the post settings, then every Meta Box field of the post type with the form field that fills it.

What the Add-on Does With Each Kind of Field

The idea is simple: the form field is the source and the Meta Box field decides the shape. Here is what that means for the common types.

Text, numbers and addresses

Text goes in as text. Numbers are cleaned, so a price typed as $1,250,000.50 or 1.250.000,50 is saved as a plain number that sorts and compares properly. An e-mail address or a web address that is not valid is skipped and mentioned in the note, instead of ending up in a field that your template prints as a link.

Choices

A select, a radio list, a button group, a checkbox list or a multiple select is matched against the options of the Meta Box field. The add-on tries the exact value, then the value in any letter case, then the label. A form choice called Heat pump therefore fills the option heat_pump, because the label of that option is Heat pump. If nothing matches, the choice is left out and named in the note.

Dates

Your visitor types a date in the order you chose in Gravity Forms. The Meta Box field may want a year first, a day first, a timestamp or a special save format. The add-on reads the first and writes the second. It also refuses dates that do not exist, so a February 30 never reaches your database.

Photos and files

Uploaded photos are copied from the Gravity Forms upload folder into the Media Library, attached to the new post and saved as attachment ids, which is exactly what a gallery or single image field stores. The first photo can also become the featured image. Only files that really sit in the upload folder are copied, so a crafted address cannot make your site fetch something from somewhere else.

Posts, users and terms

Relationship fields accept ids, titles, slugs, user logins and e-mail addresses, and check that the target exists and is of an allowed type. Taxonomy fields accept term names and slugs and put the terms on the post. You choose whether terms that do not exist are created.

Groups and repeated rows

This is where hand mapping gives up. A cloneable group, for instance a list of rooms with a name, a size and a photo, wants one entry that holds a list of rows. Map the parts of the group to the columns of a List field and every row of the list becomes one clone. A value that does not change, such as a unit of measure, can come from a single field and is used in every clone. The group extension of Meta Box provides the group fields; the add-on writes the value in the form that extension stores.

Let Owners Edit Their Own Listings

Creating posts is half the story. Real sites also need people to correct their own entries later. The update action does that without giving anyone access to the dashboard. You add a Hidden field to the form, link to the form with the id of the post, and the add-on fills the form with the values that are saved in the custom fields. The visitor changes what they want and sends it. The same post is updated, the fields they left alone keep their values, and new photos can replace or extend the gallery.

A Gravity Forms entry page with the entry note that says which property was created and which Meta Box fields were saved, and the Meta Box box with a link to the post
The entry note lists what was saved and what was skipped, and the side box links to the post.

Because this is a way into your content, the add-on checks ownership twice. When the form is shown, only the author of the post sees the saved values, and nobody else sees even an empty form with the id. When the form is sent, the post must still belong to the person who sends it, and the post type must match. If somebody edits the hidden field to point at another post, the form comes back with an error and nothing is changed. If you want editors to be able to use the same form you can allow them in the feed.

Prefill and Live Choices

Prefill works for more than editing. A profile form can open with the custom fields of the logged-in user, and a form on a page about a listing can start with the values of that listing. The same mapping you made for saving is used for filling, so there is nothing more to set up.

Choices can follow Meta Box too. If your listing type is a select field with the options house, flat and land, the Drop Down in your form can take its choices from that field. When you add an option in Meta Box, the form shows it, and a submitted option passes validation because the choices are applied again at that moment.

User Fields and Custom Tables

Meta Box can also keep fields on users, and it can keep values in a custom table for speed. Neither needs special code in a form add-on, because rwmb_set_meta hands the value to the right storage. The add-on detects meta boxes for users and offers them in a feed with the action to save the fields of the logged-in user. It also shows when a meta box uses a custom table, so you know why the values are not in the post meta table.

Tips for a Clean Setup

  • Start with the status set to draft and read a few posts before you publish automatically.
  • Name your Meta Box fields clearly. The feed shows the field names, and a good name is the best documentation.
  • Use a List field for anything that repeats. One row of the list is one clone of the group.
  • Keep the option values in Meta Box short and stable, and let the labels be friendly. The add-on matches both.
  • Use the entry note as your debugging tool. It lists what was saved, what was skipped and why.
  • For editing, link to the form from a page that only logged-in owners see, such as a dashboard that lists their listings.

Frequently Asked Questions

Do I need to know the keys of my custom fields?

No. The feed reads the registered meta boxes and shows the field names. You pick a form field from a list.

What if I add a new custom field later?

It appears in the feed the next time you open it. Fields that are not mapped are left alone.

Can I fill fields from a payment or a user?

Yes. Besides form fields the list offers the entry id, the id of the logged-in user and the date of the entry.

Will it overwrite what I saved in the dashboard?

Only fields that you mapped, and only with a value when the form field is not empty, unless you choose to clear empty fields.

Does it work without the paid Meta Box extensions?

Yes for posts. Fields on users, group fields and custom tables are features of separate extensions, and the add-on uses them when they are installed.

A good integration should disappear. Visitors fill in a form, your team finds a finished post with every custom field in the right shape, and the owners can fix their own mistakes. That is what a feed that understands Meta Box gives you, and it takes minutes to set up.

See the Gravity Forms Meta Box Integration add-on

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr