How to use ACPT with WP All Import/Export
ACPT (starting from v1.0.182) has a specific integration with WP All Import and Export, our favorite way to import to WordPress.
In this short tutorial, we’ll learn how to export and then import ACPT meta fields from/to a custom post type.
Step 1. Create a custom post type
This topic was covered multiple times, so please refer to other tutorials.
Suppose to create a CPT called “Movie” with some meta fields:
Ok, let’s move to step 2.
Step 2. Export the meta fields
Go to WP All Export and select the Movie custom post type.
Now, select the XML custom format:
In the post loop, drag the standard fields you need (ID, title, etc…) and then create a custom XML node, the name of the node doesn’t matter, and use this special PHP function:
[wpae_acpt_export_all_fields({ID})]
This function takes just the post ID as argument, and it exports the settings and the values of every Movie meta field associated with a given ID:
Go ahead and export the XML and you are good to go for Step 3.
Step 3. Import the data
Now go to WP All Import and select the obtained XML from the Export. Select import Movies:
Go straight to Step 3 and drag your data.
Note the ACPT Add-on box, which contains a text field. Drag here the ACPT meta:
Go on with the import and voila, every meta field is present in exported posts!
Importing Taxonomy or User meta fields
If you need to export/import taxonomy and user meta fields, the whole process is absolutely identical, except for the name of the php function to use:
[wpae_acpt_export_all_tax_fields({Term ID})]
[wpae_acpt_export_all_user_fields({User ID})]
Again, these functions take just one argument. Use these functions in your custom XML and import it everywhere you need.