Reputation: 19
I uploaded a product image in magento but found out it was no good. So I deleted it and uploaded another image with the same name. Now I get a _1
after the name of the image. Of course this occurs when a image already exists.
Does anybody now how I can delete all product images?
Upvotes: 1
Views: 1741
Reputation: 190
You need to remove them in two places to avoid errors. Note, the following will remove ALL images from all your products. Please backup before.
First, you need to remove them from the database. You can do this by issuing the following in phpMyAdmin or however you choose:
TRUNCATE TABLE `catalog_product_entity_media_gallery` TRUNCATE TABLE `catalog_product_entity_media_gallery_value`
Second, remove your media/catalog folder. With SSH, you would use:
rm -rf media/catalog rm -rf media/tmp rm -rf media/import (if you used an import process for your images with your products).
Upvotes: 1
Reputation: 19
Remove the file from
Upvotes: 0
Reputation: 943
Try this extension http://www.magentocommerce.com/magento-connect/image-clean.html
On sites with large product count it work slowly, but you can delete images from hard disk (those images, that have been deleted in Magento).
Upvotes: 0
Reputation: 106
Well, if you want to get rid of the image files for products, you need to go to your server (by ssh / ftp or some cPanel) and delete all contents of /media/catalog/product
. Using ssh you should do this that way:
ssh login@host [-p {port} # only if it's not 22 which is default, often it's also 2222 or 2223]
cd /path/to/your/magento/root
rm -rf /media/catalog/product/*
But have in mind that it will delete ALL product images in your Magento instance and may cause errors if some of this files are set as your current product images.
Upvotes: 1