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.
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.
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?