I'm trying to remove product images in Magento 2, but all I can find is how to do it in Magento 1, which is very different.
Here is what I found for Magento 1:
if ($product->getId()){
$mediaApi = Mage::getModel("catalog/product_attribute_media_api");
$items = $mediaApi->items($product->getId());
foreach($items as $item)
$mediaApi->remove($product->getId(), $item['file']);
}
Anyone know how to accomplish this?