How to Match and Import Relationship Fields into PODS

CIO Custom Fields Importer plugin is an add-on plugin to WP All Import. It is a bridge connecting another two powerful plugins together.  CIO Custom Fields Importer plugin seamlessly works together with WP All Import (free or professional version), and PODS (free) to import from a variety of data formats, to ALL content types and ALL field types of PODS. The import process is well integrated into WP All Import’s 4-step import processes.

Examples of PODS content types supported: page, post, user, comment, taxonomy (categories, tags, or custom taxonomies), PODS Advanced Content Type (ACT).

Examples of PODS field types supported: text, numbers, dates and time, relationships, images, file attachments.

The advantage of WP All Import professional version is that you can set up import tasks to run automatically, and to import from a link. This makes automated updates possible.

One of the reasons customers bought CIO Custom Fields Importer plugin is to import relationships into PODS. This tutorial gives some examples of how to set up the import template.

When you are at step 3 of the import set up processes, you will see a section for the content type you are importing in PODS, and the custom fields you have created.

If you have relationships to import, here is how the import template should look like.

MATCH options and comments (related_column_name_to_search : value_to_search )

The MATCH keyword reserves parentheses and colon ( : ) to mark a key/value pair in the import template. You can write arbitrary comments between MATCH and the opening parenthesis.

Example 1, custom field related to WordPress’s built in table field

For example if you have a custom field related to the post_title field of custom post type “product”.  You have a source CSV file and the product names are stored in a column called “related_product_name”. Each product name is separated by a comma.

When you import, you can write in the import template:

MATCH ( post_title :  {related_product_name[1]} )

or

MATCH for item id, from the post_title column, using values from my source file ( post_title :  {related_product_name[1]} )

CIO importer looks for keywords in your import template. You can write any comments  between MATCH and “(“ to help you to remember the relationship mapping in the future.

Example 2, custom field related to a meta field

For example if you have a custom field related to the _SKU field of custom post type “product”, and the _SKU field is stored as a meta field in wp_postmeta table.  You have a source CSV file and the SKU is stored in a column called “related_product_sku”. The actual SKU values are separated by the bar symbol (‘|’).

When you import, you can write in the import template:

MATCH in META table, separate value by ‘|’ (_SKU :  {related_product_sku[1]} )

or

MATCH for item id in META fields, value separated by ‘|’ (_SKU :  {related_product_sku[1]} )

Example 3, custom field related to a custom field using pods table storage

For example if you have a custom field related to the “translations” field of custom post type “book”, and you created the “book” custom post type using pods table storage, (storing custom fields in a separate table instead of wp_postmeta table). You have a source CSV file and the translations are stored in a column called “translations_available”. The actual translations are separated by a comma.

When you import, you can write in the import template:

MATCH in PODS TABLE ( translations  :  {translations_available[1]} )

or

MATCH for item id in PODS TABLE, from column translations ( translations  :  {translations_available[1]} )

Example 4, custom field related to WordPress’s built in table field containing (:)

The MATCH keyword reserves parentheses and colon (:) to mark key/value pairs. To match against values containing the reserved symbols, please use one of the following keywords. MATCH_DOUBLE and MATCH_TRIPLE  are available in version 1.2.6.

MATCH_DOUBLE, which uses double symbols ((::)) to mark key/value pairs,

MATCH_TRIPLE, which uses triple symbols (((:::))) to mark key/value pairs.

Here are two complete import template examples.

MATCH_DOUBLE (( post_title ::  {related_product_name[1]} ))

MATCH_TRIPLE ((( post_title :::  {related_product_name[1]} )))

Summary of Keywords in Import Template

The following strings and symbols are parsed by CIO to decide which function to run in the import process:

MATCH    :     this trigger matching field and value for id, reserving (:) to mark key/value pairs

MATCH_DOUBLE : this trigger matching field and value for id, reserving double symbols (( :: )) to mark key/value pairs

MATCH_TRIPLE : this trigger matching field and value for id, reserving triple symbols ((( ::: ))) to mark key/value pairs

META    :     this specifies matching against meta field

PODS TABLE:     this specifies matching custom fields stored in a separate table.

‘’         :     the single quotes before () are used to define how your values are separated. Please note WP All Import reserves double quotes in the import template to execute custom functions.  The default separator is a comma.

(  :  )        :    inside the parentheses, the string before colon is field name, and the strings after colon are field values to match. These symbols are repeated two times (( :: )) with MATCH_DOUBLE, and are repeated three times  ((( ::: ))) with MATCH_TRIPLE.

Please contact us if you need additional help with setting up the import template.