cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove product images programmatically?

How to remove product images programmatically?

I use code snipet from http://webkul.com/blog/magento2-programmatically-remove-existing-images-and-add-new-image-to-product...

 

But it doesn't work for me.

 

Please give me a clue. How to remove all images for product.

 

Thank you.

2 REPLIES 2

Re: How to remove product images programmatically?

Since no one replied you yet, and in case you still need a solution,  I wanted to ask if you consider extension as a solution.

 

If yes, you can use free version of Store Manager for Magento app (you can download it from my signature). To remove images you simply need to:

1)  Select products

2) Click on bulk data clear option within the app

3) Chose to clear images

That's it. Here is the tutorial that shows how it works in action -

https://www.mag-manager.com/useful-articles/how-to/how-to-bulk-clear-magento-product-data/

 

This way you can do the task easily and absolutely free.

Store Manager for Magento 1.x and 2.x - inventory management tool to automatically update products, customers, orders, and other data across multiple sales channels and suppliers.

Re: How to remove product images programmatically?

It looks like this code doesn't work in latest Magento versions (2.1.2, 2.1.3)
I'm also have this issue and don't know how to fix it.

 

Does anybody know how to solve it?