External Variation Images & WP All Import
1) I created a custom field called 'external_image_url' in WP All Import and images are importing. Most are under the same met_key that was created, but some are added under '_external_image_url'.
2) Variation images aren't importing. I manually added an external image url to a variation and can see in the database that it used the met_key '_external_image_url', but variation images don't seem to be working with WP All Import.
Everything else is setup correctly, as I was using an alternative plugin to import external images.
To clarify on the meta fields:
external_image_url is the field you import to. This is ideally pipe | separated list of image URLs, but it can also be comma separated. Preferably pipe though because some images on some CDNs will include commas.
The first of those images is loaded into the _external_image_url field as an image array.
The gallery images (everything after the first image from external_image_url) are loaded into the _ei_wcgallery field as an array of arrays. This approach makes it fast to pull those arrays in the correct format needed for WordPress.
If you later update the external_image_url field, there is an action hook added to update_post_meta and delete_post_meta which will rebuild the hidden _external_image_url and _ei_wcgallery fields.
So – basically, don’t import to the hidden fields – just import to the external_image_url field with pipe separation between image URLs and the plugin will handle the rest. That’s the same for everything – products, product variations, posts, custom posts etc.
If you are using custom posts, the custom posts need to declare gallery support in order for the gallery to work in custom posts.
Also – there is a bug in the currently live version when editing an existing custom post gallery – it won’t apply the changes currently – this is fixed in beta which is in your downloads area in My Accounts.
I second the option of being able to specify a main product image in one field, and gallery images in another field.. as an option but it would be great if but could work both ways
They will be replaced. When the external_image_url field gets updated, it causes a function to run to update the hidden _external_image_url to be an array image version of whatever list of images is in external_image_url. The first image will be the featured image, all others will be gallery images. I did in the past have a separate field for gallery images and I could reintroduce this if you wish – this would mean that you could, optionally, keep 1 featured image in the external_image_url field and then your gallery images into a different meta field.
Hi Dave, I have separate imports for featured and gallery images. I’ve imported all featured images to external_image_url. If I import all gallery images to external_image_url, will the featured image be replaced or will it just add additional images to the product gallery?