Export WooCommerce Products with Images
To export WooCommerce products with images, export products but include fields from Available Data › Media › Images in your export. If needed, you can modify the content of image fields using techniques in the Advanced Topics section.
Table of Contents
- Step 1: Create a New Product Export
- Step 2: Customize the Export File
- Step 3: Configure Your Export Settings
- Step 4: Download the Export File
Advanced Topics
- Bulk Edit the Meta Data or SEO Fields
- Extra Images Being Exported
- How to Export the Images Separately?
Step 1: Create a New Product Export
Go to All Export › New Export in your WordPress dashboard, then select WooCommerce Products as your export type.
To filter your export, expand the Add Filtering Options section. For more information, see How to Filter Exported Data.
To continue, click on the Customize Export File button.
Step 2: Customize the Export File to Include Product Images
You now see the Drag & Drop screen, where you can customize your export file. Select your export columns by dragging them from the Available Data panel on the right to the column selection area. To export product images, make sure to select fields from the Media › Images subsection.
Once you've added your desired fields, click Continue at the bottom (not shown).
Step 3: Configure Your Export Settings
You now see the Export Settings screen:
Here, you can schedule your export to run every week or every month in the Scheduling Options section.
The Advanced Options section lets you:
- Control what happens if you run the same export again (i.e., whether to export only new or modified products);
- Configure the batch processing size to avoid overwhelming server resources;
- Split large exports into multiple files;
...among other options.
For now, leave all these settings with their default values and instead click the Confirm & Run Export button.
Step 4: Download the Export File
The Confirm & Run screen appears next. Some processing information may temporarily appear, but you will eventually see the Export Complete message.
At this point, you can download your export file and use it for migration, backups, or other purposes. In this example, because we included the Image URL among our export columns, the URL for each product image will be included in the export.
Export WooCommerce Products with Images — Advanced Topics
Bulk Edit the Product's Images Meta Data or SEO Fields
You can modify all image metadata in bulk, including metadata for product images, using WP All Export and WP All Import. These are the fields you can modify: image titles, descriptions, alt text, and captions. Here's how you do it:
1. Go to All Export › New Export and select WP_Query Results to export the attachments. Use the following query:
"post_type" => "attachment", "post_status" => "inherit", "post_mime_type" => array( "image/jpeg", "image/gif", "image/png", "image/bmp", "image/tiff", "image/x-icon" )
2. Add the following fields to your export template:
(Image ID) ID (Image Filename) _wp_attached_file (Image Title) Title (Image Description) Content (Image Caption) Excerpt (Image Alt Text) _wp_attachment_image_alt
3. Run the export and edit the data in your favorite spreadsheet software.
4. To reimport the attachments, go to All Import › New Import and upload the updated export file. Select New Items › Posts, then continue to Step 3. In Step 3, you'll need to:
- Type in a dummy post title: https://d.pr/i/CrkFtY.
- Import your image data like so: https://d.pr/i/KE0RrJ.
- Set the Post Status to trash: https://d.pr/i/Ket16F.
5. Continue to Step 4 and do the following:
- Type in a static unique identifier.
- Disable skipping unchanged posts.
- Choose to only update images for existing posts.
See how Step 4 should look: https://d.pr/i/wFmtZz.
Now, you can run the import to update all of your images. There will be a dummy post left in the trash once it's done, which you can optionally delete.
Extra Images Being Exported
In some cases, there may be more images attached to the product than those shown on the product edit page. Use the following custom code to export the images attached to your exported products:
function my_get_product_image_gallery( $id ) {
$images = array();
$product = wc_get_product( $id );
if ( ! $product ) return;
$images[] = wp_get_attachment_url( $product->get_image_id() );
$gallery = $product->get_gallery_image_ids();
if ( ! empty( $gallery ) ) {
$gallery = maybe_unserialize( $gallery );
foreach ( $gallery as $gallery_id ) {
$images[] = wp_get_attachment_url( trim( $gallery_id ) );
}
}
return implode( '|', $images );
}
This code is used like this:
How to Export the Images Separately?
Assuming that you're exporting CSV, you can separate multiple images in different columns using custom code and custom export fields:
function my_get_image( $images, $image = 0 ) {
if ( empty( $images ) ) return;
$images = explode( '|', $images );
if ( array_key_exists( $image, $images ) ) {
return $images[ $image ];
}
}
Here's some example usage:
[my_get_image({Image URL},"1")]
[my_get_image({Image URL},"2")]
[my_get_image({Image URL},"3")]
Add a new custom export field for each new image or column you want to add, while modifying the second parameter, i.e., the number passed to the $image variable. You can learn more about custom export fields here: Combine and Process Multiple Data Elements into a Custom Export Field.
Export WooCommerce Products to CSV, XML, or Excel
- Product images & gallery
- Price & stock
- Custom fields
- Zapier integration
- Scheduling
- Real-Time exports
Export WooCommerce Products with Images — Frequently Asked Questions
How Do I Export the Image Files Directly?
Unfortunately, this isn't possible as WP All Export doesn't support exporting images in this fashion. Instead, you'll be able to export all image data, including a URL to access/download each image. WP All Import can use that image URL to download the image and import it onto another site.
How Do I Export All Products From WooCommerce?
- Go to All Export › New Export
- Choose to export WooCommerce Products. Do NOT set any filters.
- Customize the Export File and include all of your desired export fields.
- Process the export and download the exported products.
You can learn more about this process here: How to Export WooCommerce Products.
How Do I Export All Products from WooCommerce with Images?
To export all products from WooCommerce with images, follow the steps in the previous answer, except include Media > Images fields in your export columns.
How Do I Export a Specific Product from WooCommerce?
Just run a standard product export using WP All Export but with a filter that selects the specific product in question. If you want to include image data with that product, select the relevant fields from Available Data Media > Images.
How Do I Upload Bulk Products with Images in WooCommerce?
- Navigate to All Import › New Import.
- Choose your import file and your import target (i.e., WooCommmerce Products).
- Map the incoming data elements to your WooCommerce product fields using drag & drop. Make sure to include image data in this mapping process.
- Run the import.
For more information, see Import WooCommerce Products with Images.
How Do I Bulk Edit WooCommerce Products?
- Export the products that you want to edit.
- Edit the export file in your favorite spreadsheet, where you can use advanced editing features such as copy and paste, search-and-replace functions, etc.
- Import the edited file into WooCommerce.
- Verify your results.
To learn more, please see Easily Bulk Edit WooCommerce Products.
How to Export WooCommerce Attributes in a Multilingual Environment Using Cron Jobs?
If you're exporting WooCommerce attributes in a multilingual environment and want to use cron jobs or Automatic Scheduling to automate the export, you should configure the export template while logged into a WordPress user account that uses the site's default language. This is necessary because WooCommerce adds the word "Product" to the attribute elements based on the language of the current user. Since automatic exports use the site's default language, configuring the export with a user that does not use the site's default language will result in the attribute elements being blank.
What Add-Ons Do I Need to Export WooCommerce Products?
To export WooCommerce products, you need to have the WooCommerce Export Add-On active on your site, along with WP All Export.
Export WooCommerce Products with Images — Related Docs
Learn how to export WooCommerce products.
Learn how to import WooCommerce products.
Describes how to export WooCommerce variable products.
Describes how to import WooCommerce variable products.
Learn how to import WooCommerce products with images.
Describes how to bulk edit WooCommerce products.
Describes how to migrate WooCommerce products from one website to another.
Learn more about WP_Query exports.