How to Import Attribute Swatches with WP All Import for WooCommerce
Content
Many users of the 'Variation Swatches for WooCommerce' plugin need to import or migrate product data, including custom swatch images and colors, using popular tools like WP All Import. A common challenge is identifying the correct meta fields and data formats for a successful import. This guide explains the process based on community-shared solutions.
The Core Challenge
The plugin stores swatch information (like images for color or image swatches) as term meta data associated with the product attribute terms in your WordPress database. Standard WooCommerce export/import CSV files often do not include these custom fields, leading to swatch data being left behind during migration.
Solution: Using WP All Import to Map Swatch Data
Based on user reports and successful implementations, you can map your imported data to the plugin's term meta fields within WP All Import's interface. Here are the key meta keys and the correct data format to use:
- For the Swatch Type: The term meta key is
product_attribute_type. The value for this field should be one of the following:color,image, orlabel. - For a Color Swatch Value: The term meta key is
product_attribute_color. The value should be a hex color code (e.g.,#ff0000). - For an Image Swatch Value: The term meta key is
product_attribute_image. The most reliable method is to use the Attachment ID of the image in your WordPress Media Library as the value for this field.
Important Note on Image Import
As confirmed by user experience, importing an image using its full URL (e.g., https://yourdomain.com/wp-content/uploads/image.jpg) may not work correctly for the product_attribute_image field. The consistent method that works is using the image's Attachment ID. WP All Import has robust features for importing images and returning their IDs, which you can then assign to this field during your import process.
Summary of Steps for WP All Import
- Ensure your import file contains columns for your attribute names (e.g., pa_color) and the corresponding swatch data (type, color code, or image ID).
- In WP All Import, when mapping your data to import to attribute terms, use the 'Term Meta' section.
- Map your data to the correct meta keys listed above (
product_attribute_type,product_attribute_color,product_attribute_image). - For images, use the attachment ID sourced from your media library or from WP All Import's own image import processing.
By correctly mapping your data to these specific term meta fields, you can successfully import or migrate your attribute swatch settings from another system or via a CSV file.
Related Support Threads Support
-
REST API Supporthttps://wordpress.org/support/topic/rest-api-support-23/
-
attribute keys for importinghttps://wordpress.org/support/topic/attribute-keys-for-importing/
-
is the plugin support wp allimporthttps://wordpress.org/support/topic/is-the-plugin-support-wp-allimport/
-
Image wp all importhttps://wordpress.org/support/topic/image-wp-all-import/
-
Importing from old website is not workinghttps://wordpress.org/support/topic/importing-from-old-website-is-not-working/
-
WP All Import Attribute Imagehttps://wordpress.org/support/topic/wp-all-import-attribute-image/
-
Import image attribue with wpallimporthttps://wordpress.org/support/topic/import-image-attribue-with-wpallimport/