WooCommerce: How to Export/Import Product Featured Images

When you run the WordPress Import Tool from an .xml file belonging to another website (included dummy data from template developers), WooCommerce product images don’t get imported! HOW ANNOYING! Here’s how I fixed it.

The issue: after importing, WooCommerce products have no images

WooCommerce product images not importing
WooCommerce product images not importing

The solution: use the core WooCommerce import/export functionality

That’s it 🙂

Go to WordPress Dashboard > Products > Import (or Export) and follow the instructions.

This is a new functionality introduced since WooCommerce 3.0 and it’s working like a charm.

For more advanced import/export, automatic updates from server and more complex functionalities, take a look at http://www.wpallimport.com/woocommerce-product-import/, a product used by many of us.

Where to add this snippet?

You can place PHP snippets at the bottom of your child theme functions.php file (before "?>" if you have it). CSS, on the other hand, goes in your child theme style.css file. Make sure you know what you are doing when editing such files - if you need more guidance, please take a look at my free video tutorial "Where to Place WooCommerce Customization?"

Does this snippet (still) work?

Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting on PHP 7+.

If you think this code saved you time & money, please join other Business Bloomer supporters and avail of 365 days of WooCommerce benefits. Thank you in advance :)

Need Help with WooCommerce Customization?

Check out these free video tutorials. You can start learning how to customize WooCommerce without unnecessary plugins. Watch me code and learn by example!

  • how-to-edit-woocommerce-with-php-snippets
  • woocommerce-hooks-add_action-list-visual
  • woocommerce-customize-single-product-page-PHP

Rodolfo Melogli

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as a WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

20 thoughts on “WooCommerce: How to Export/Import Product Featured Images

  1. The plugin does not import images. I get error codes.
    Then your article goes into “PHP Snippets” without any context. What are the snippets for and where is the code? You were talking about a plugin which is installed normally, not with code.
    Just a very confusing article and the plugin does not import my images.

    1. Shelly, thanks so much for your comment! You’re right, the plugin hasn’t been updated in over 4 years 🙂 Just so you know, WooCommerce now allows you to export/import products out of the box: go to Products > Export or Products > Import. Let me know if that exports/imports images as well.

    2. Rodolfo, the core WooCommerce export/import products does import the product images correctly.

  2. Thanks!
    It still works, but without gallery images 🙂

    1. Thanks for your feedback Dawid!!!

  3. Good morning Rodolfo,
    I need your help. I’m using wp all import to import massive product in woo commerce.
    My need now is to import the product category image in order not to have import one each manually.
    Does exist a sort of plug in for solving my need?
    thanks for you attention

    1. Hey Matteo, thanks for your comment! If I were you I’d contact WP All Import support, as tat is the reason you’re paying for a premium plugin – I’d be surprised if you can’t achieve what you want with their help 🙂 Let me know how it goes!

  4. Hi Rodolfo Melogli,

    Nice plugin to Export all woocommerce product images. I have use this plugin and it’s export all product featured image form one store to another. But till i am face one issues. It’s can’t export product gallery images. So please help me how to export product gallery images also.

    I am waiting your replay.


    1. Hey Ketan thanks for your comment! This plugin hasn’t been updated in 2 years so I’m not sure it even works… but in regard to the product gallery I’m afraid you will need a premium export/import plugin. I use WP All Import with WooCommerce add-on which is quite expensive – not sure about the others to be honest 🙂

  5. Thanks for this article, exactly what i needed!

  6. Do you export as posts or products? I tried both and both failed. Thanks for the suggestion – hope I can get it to work.

    1. Yes, it seems that free plugin hasn’t been updated in 2 years. However you don;t export as posts or products, you have to go to Tools-> Export Featured images. Did you try that already?

  7. import failed

    1. RJ thanks for your feedback! What error did you get?

      1. I had the same problem. Once I tried to import it said “Import Failed”. This is what I see for all 696 of my product featured image names:

        Failed to import Media “download”
        Failed to import Media “canopla-microfone-digital-video-destaque”
        Failed to import Media “cloud-activator-cl1-cloudlifter-mic-2”
        Failed to import Media “canopla-microfone-1”
        Failed to import Media “avisos-luminosos-para-radios-tx”
        Failed to import Media “avisos-luminosos-led-amarelo-destaque”
        Failed to import Media “auralex-mudguard-mic-shild”
        Failed to import Media “Suporte Para Microfone Mika Yellowtec”
        Failed to import Media “Mika Estudio de Luz”
        Failed to import Media “Filtro pop para Micronone qmic q25”
        Failed to import Media “Q-mic 27g filtro pop microfone”
        Failed to import Media “Q-Mic QM-30 Pop Filter”
        Failed to import Media “Q-MIC REFLEXION FILTER QM-101”

        1. Hey Felicia thanks for your feedback! If you followed my instructions then it could be that the plugin hasn’t been updated in 2 years. There are paid plugins that would do the transfer very easy, however your error could also be due to the Upload Limit in WordPress. Have you tried with other imports, do they fail as well?

  8. Thank you, this plugin is exactly what I needed.

Questions? Feedback? Support? Leave your Comment Now!

If you are writing code, please wrap it between: [php]code_here[/php]. Failure to complying with this (as well as going off topic) will result in comment deletion. You should expect a reply in about a week - this is a popular blog but I need to get paid work done first. Please consider joining #BloomerArmada to ask me 1-to-1 WooCommerce questions. Thank you :)

Your email address will not be published. Required fields are marked *