Images doubling in WordPress Media storage

Modified on Thu, 10 Oct 2019 at 09:49 AM

When Valigara updates a product on WooCommerce, product images are uploaded again to WordPress Media storage. Old images are not deleted, they double in Media storage. 

This is a well-known Wordpress/WooCommerce behavior. According to nature of WP/Woo,  images are uploaded to Media gallery, and after it are attached to some entity (product/post etc.) . Valigara has no possibility to do something with previous images. There are several WordPress plugins that remove unattached media. 

To reduce media gallery duplicates, specific logic is implemented in Valigara:

- on product revise, Valigara checks if product images have changed from the last/post revise. Only if they have, Valigara uploads the new images to WC, and existing images in the product are replaced by new images. 

- Valigara stores relations between Valigara images to WooCommerce images.  On revise Valigara submits relation info and not image url. 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article