• Resolved aristosv

    (@aristosv)


    I’m about to delete 500 products from WooCommerce and I really don’t want to leave behind all those orphaned images taking up space on the disk and entries in the database.

    I found many code snippets but they are old, and replies show that they are not working. I also found a plugin, but it’s been 4 months since it was updated. And selecting “Unattached” in the media library, actually shows me images that are used in pages and by other plugins.

    Is there a reliable way of deleting product images when deleting a product from WooCommerce?

    • This topic was modified 4 years, 2 months ago by aristosv.
Viewing 1 replies (of 1 total)
  • Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @aristosv. With WordPress and WooCommerce, by default product images are not deleted when a product is deleted. Images will remain in the Media Gallery and can be deleted manually.

    As you’ve noted, there are third-party plugins that might be capable of deleting images from the Media Library when associated products are deleted but those plugins are not developed or supported by us so we can’t guarantee that they will work as expected. I am not familiar with any specific ones to be able to make a recommendation here. You may want to test them on a test/staging site to see if any of them meet your needs.

Viewing 1 replies (of 1 total)
  • The topic ‘delete image when deleting a product’ is closed to new replies.