Importing all Meta Box custom fields - Using WP All Import
To import all Meta Box custom fields, you need to map their corresponding data during the import process in WP All Import.
This documentation provides more details on each field and what’s imported for it when using the Meta Box Import Add-On by WP All Import.
To learn how the import process works, please see this tutorial.
1. Basic fields:
These are the most common fields that you can import. Here's more on each basic field type available:
1.1. Text
Simple plain-text field. Imports text.
1.2. Textarea
Same as a text field but with a bigger area. Imports text.
1.3. Checkbox List
Multiple choice field. When importing multiple values, separate with a comma. If you have both values and labels in the field definition, use the values. You can use the Select value for all records option to choose the same value for all records:
Alternatively, you can use the Set with XPath option to import values dynamically:
1.4. Checkbox
Single choice field. Imports a value for checked and no value for unchecked.
1.5. Radio
List of radio inputs where you select a single choice. Imports the value as text.
1.6. Select
Select the dropdown to choose one or multiple values. When importing multiple values, separate with a comma. If you have both values and labels in the field definition, use the values.
2. Advanced Fields:
These contain most of the Meta Box custom fields available to import. Below are more details on each advanced field.
2.1. Autocomplete
Plain-text field with autocomplete features. When importing multiple values, separate with a comma. If you have both values and labels in the field definition, use the values.
2.2. Background
This lets you set the background color, select an image, and set other background settings.
2.3. Button Group
This field lets you select one or more options by enabling buttons from a button group.
2.4. Color Picker
This field lets you select a color. You have to specify the color hex code preceded by a numeral, e.g., #ea5f1a
.
2.5. Date Picker
This field stores a date value. You can import any date format supported by the PHP strtotime() function.
2.6. Datetime Picker
This field stores a date and time value. Use any format supported by the PHP strtotime() function.
2.7. Fieldset Text
This field is a set of text inputs. You can import values into each text input separately.
2.8. Hidden
Simple hidden input text.
2.9. Icon
Imports an icon class name.
2.10. Image Select
This field allows you to select a choice visually with images, which works similarly to a radio/checkbox field. When importing multiple values, separate with a comma. If you have both values and labels in the field definition, use the values.
2.11. Key Value
This field allows you to input an unlimited group of "key-value" pairs. You can choose between Fixed, Variable (XML), or Variable (CSV). The interface lets you define these fields.
You can learn more about importing this data here: Cloneable & Repeater Fields.
2.12. oEmbed
Simple text input to import a media URL and show that media. Imports text.
2.12. Password
Simple password input field.
2.13. Select Advanced
This field creates a select dropdown field with the select2 library. When importing multiple values, separate with a comma. If you have both values and labels in the field definition, use the values.
2.14. jQuery UI Slider
This field uses a slider to select a number. Imports a numerical value.
2.15. Switch
This field shows an on/off switch to enable or disable something. You have to import 1
for on and 0
for off.
2.16. Text List
This is a field with a list of text inputs. Each field available to import will have its own input.
2.17. Time Picker
This field lets you select a time. You can use any date format supported by the PHP strtotime() function.
2.18. WYSIWYG Editor
This is the What-You-See-Is-What-You-Get field. It provides a bigger text field input to bring in any content you need.
3. HTML5 Fields:
These are the fields for HTML5 input types. They act similar to a text input but for other data types. Here’s more on each HTML5 field type available:
- Email: Plain-text field for an email.
- Number: Plain-text field for a number.
- Range: Plain-text field to import the number range.
- URL: Plain-text field to import a URL.
4. WordPress Fields:
These are fields related to WordPress data that you need to link to from Meta Box. Here’s more on each WordPress field type available:
- Post: This field links with a post type or custom post type. It accepts post ID, slug, or a title. You can use a separator character to import multiple entries.
- Sidebar: This field links to a sidebar from the site.
- Taxonomy: This field links with a taxonomy from the site and sets post terms.
- Taxonomy Advanced: This field also links with a taxonomy from the site but stores term IDs instead.
- User: This field links with a user on the site.
Learn more about importing these fields here: How to Import Meta Box WordPress Fields.
5. Upload Fields:
These fields allow handling attachments and files, as well as images. Here’s more on each upload field type available:
- File: Single file upload file.
- File Advanced: Multiple file upload.
- File Upload: Upload area where you can drag and drop files to upload.
- Image: Single image upload.
- Image Advanced: Multiple image upload.
- Image Upload: Inline upload area where you can drag and drop or select images to upload.
- Single Image: Select or upload one image via the WordPress media library.
- Video: Video field.
All of these fields look the same during import. Here’s how the File field looks:
The only different field is Single Image, which looks like this:
Learn more about importing these fields here: How to Import Meta Box Upload Fields.
6. Cloneable & Repeater Fields
All field types can be turned into cloneable with Meta Box. Here’s more on the different methods available to import cloneable fields:
6.1. Fixed
This is used when each data piece is stored in its own column, i.e., using separate elements. For example, if you have a cloneable field containing a link, and your CSV file has five columns – url_one, url_two, url_three, etc:
In this scenario, you manually add five rows to the cloneable field via + Add more and drag and drop each field into its corresponding place:
6.2. Variable (XML)
When importing an XML, data can be stored as sibling elements. For example:
<images>
<image>image_example_1.jpg</image>
<image>image_example_2.jpg</image>
<image>image_example_3.jpg</image>
<image>image_example_4.jpg</image>
<image>image_example_5.jpg</image>
</images>
Since drag & drop won’t create the correct XPath, you should provide an XPath using the FOREACH syntax available in WP All Import: Processing and Grouping Multiple Elements with FOREACH Loops.
6.3. Variable (CSV)
This option is handy when your data is stored in a single column in your CSV file, separated using a separator character.
For example, if you have a cloneable field with a list of colors and their hex codes, and both pieces of data are stored within their own columns inside the CSV file:
You must update the Separator Character, since it’s different, and then drag & drop each column into the appropriate sub-field. This is how that looks:
When this Meta Box cloneable data gets imported, the first item in the color column will be associated with the first hex code, the 2nd item in the color column with the 2nd hex code, and so on.
You can learn more about importing cloneable fields here: How to Import Meta Box Cloneable & Repeater Fields.