Bulk remove all product images from a Magento 2 shopMagento Delete all Product ImagesProduct images use default valueUpdating product images programmaticallyCan Default Magento Export Profile Export All Gallery Images?Use CDN url instead of image path with mysql bulk importProgramatically add images to product using skuProduct Catalog images cannot be indexedConfigurable product doesn't show simple product imagesExclude Swatch Image from Product Images when creating galleryGallery images returns 0 images for product page Magento 2How to remove hundreds seperator from all prices
What's the big deal about the Nazgûl losing their horses?
Is it possible that Curiosity measured its own methane or failed doing the spectrometry?
CPA filed late returns, stating I would get money; IRS says they were filed too late
How to take personal thing I lend to be used in the office without burning bridges?
Is it bad to suddenly introduce another element to your fantasy world a good ways into the story?
Before the 13th Amendment, could people sell themselves into slavery in the USA?
Why weren't Gemini capsules given names?
Question about targeting a Hexproof creature
How did Einstein know the speed of light was constant?
Convenience stores in India
PhD: When to quit and move on?
How to deal with a Murder Hobo Paladin?
Do I need to be legally qualified to install a Hive smart thermostat?
Did Snape really give Umbridge a fake Veritaserum potion that Harry later pretended to drink?
What do you call the angle of the direction of an airplane?
Taking advantage when the HR forgets to communicate the rules
What is the name of the technique when an element is repeated at different scales?
Recursive conversion from ExpandoObject to Dictionary<string, object>
Has there ever been a cold war other than between the U.S. and the U.S.S.R.?
What is exact meaning of “ich wäre gern”?
Is it possible to spoof an IP address to an exact number?
Explain how 'Sharing the burden' puzzle from Professor Layton and the Miracle Mask should be solved
Creating patterns
What is the addition in the re-released version of Avengers: Endgame?
Bulk remove all product images from a Magento 2 shop
Magento Delete all Product ImagesProduct images use default valueUpdating product images programmaticallyCan Default Magento Export Profile Export All Gallery Images?Use CDN url instead of image path with mysql bulk importProgramatically add images to product using skuProduct Catalog images cannot be indexedConfigurable product doesn't show simple product imagesExclude Swatch Image from Product Images when creating galleryGallery images returns 0 images for product page Magento 2How to remove hundreds seperator from all prices
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
We would like to remove all product images from the database and the file-system in Magento 2.2.8 shop.
There is a solution for Magento 1
Magento Delete all Product Images
Can this easily be adapted to Magento 2?
I am thinking about
rm -r pub/media/catalog/product/? pub/media/catalog/product/cache # keeping placeholder folder
- And deleting from some tables in the database (which one) ?
- Reindex
is this safe or are complications to expect?
We rather would not like to iterate over each product and save it, because of performance reasons.
gallery magento2.2.8
add a comment |
We would like to remove all product images from the database and the file-system in Magento 2.2.8 shop.
There is a solution for Magento 1
Magento Delete all Product Images
Can this easily be adapted to Magento 2?
I am thinking about
rm -r pub/media/catalog/product/? pub/media/catalog/product/cache # keeping placeholder folder
- And deleting from some tables in the database (which one) ?
- Reindex
is this safe or are complications to expect?
We rather would not like to iterate over each product and save it, because of performance reasons.
gallery magento2.2.8
add a comment |
We would like to remove all product images from the database and the file-system in Magento 2.2.8 shop.
There is a solution for Magento 1
Magento Delete all Product Images
Can this easily be adapted to Magento 2?
I am thinking about
rm -r pub/media/catalog/product/? pub/media/catalog/product/cache # keeping placeholder folder
- And deleting from some tables in the database (which one) ?
- Reindex
is this safe or are complications to expect?
We rather would not like to iterate over each product and save it, because of performance reasons.
gallery magento2.2.8
We would like to remove all product images from the database and the file-system in Magento 2.2.8 shop.
There is a solution for Magento 1
Magento Delete all Product Images
Can this easily be adapted to Magento 2?
I am thinking about
rm -r pub/media/catalog/product/? pub/media/catalog/product/cache # keeping placeholder folder
- And deleting from some tables in the database (which one) ?
- Reindex
is this safe or are complications to expect?
We rather would not like to iterate over each product and save it, because of performance reasons.
gallery magento2.2.8
gallery magento2.2.8
asked Jun 26 at 7:00
AlexAlex
9,48417 gold badges56 silver badges118 bronze badges
9,48417 gold badges56 silver badges118 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Apart from:
catalog_product_entity_media_gallery
and
catalog_product_entity_media_gallery_value
tables, now Magento 2 has one more table
catalog_product_entity_media_gallery_value_to_entity
,
which keeps track of removal of product in catalog_product_entity
table, and relates this table to catalog_product_entity_media_gallery
.
You need to check this table also.
One more table (catalog_product_entity_media_gallery_value_video
) has been introduced in Magento 2, which keeps entries related to product videos.
Please review this table if you have any videos for products.
After the database operation, you can remove the image files from:
pub/media/catalog/product/ folder
pub/media/catalog/product/cache # keeping placeholder folder
That's all.
Note: Keep a backup of the database before doing any exercise on the database.
add a comment |
Based on mohit's answer:
truncate catalog_product_entity_media_gallery_value;
truncate catalog_product_entity_media_gallery_value_to_entity;
delete from catalog_product_entity_media_gallery; # 9 sec
delete from catalog_product_entity_varchar where attribute_id in ( select
attribute_id from eav_attribute where attribute_code like "%image" and
entity_type_id = 4 ); # 23 sec in our case (20000 Products)
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f279633%2fbulk-remove-all-product-images-from-a-magento-2-shop%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Apart from:
catalog_product_entity_media_gallery
and
catalog_product_entity_media_gallery_value
tables, now Magento 2 has one more table
catalog_product_entity_media_gallery_value_to_entity
,
which keeps track of removal of product in catalog_product_entity
table, and relates this table to catalog_product_entity_media_gallery
.
You need to check this table also.
One more table (catalog_product_entity_media_gallery_value_video
) has been introduced in Magento 2, which keeps entries related to product videos.
Please review this table if you have any videos for products.
After the database operation, you can remove the image files from:
pub/media/catalog/product/ folder
pub/media/catalog/product/cache # keeping placeholder folder
That's all.
Note: Keep a backup of the database before doing any exercise on the database.
add a comment |
Apart from:
catalog_product_entity_media_gallery
and
catalog_product_entity_media_gallery_value
tables, now Magento 2 has one more table
catalog_product_entity_media_gallery_value_to_entity
,
which keeps track of removal of product in catalog_product_entity
table, and relates this table to catalog_product_entity_media_gallery
.
You need to check this table also.
One more table (catalog_product_entity_media_gallery_value_video
) has been introduced in Magento 2, which keeps entries related to product videos.
Please review this table if you have any videos for products.
After the database operation, you can remove the image files from:
pub/media/catalog/product/ folder
pub/media/catalog/product/cache # keeping placeholder folder
That's all.
Note: Keep a backup of the database before doing any exercise on the database.
add a comment |
Apart from:
catalog_product_entity_media_gallery
and
catalog_product_entity_media_gallery_value
tables, now Magento 2 has one more table
catalog_product_entity_media_gallery_value_to_entity
,
which keeps track of removal of product in catalog_product_entity
table, and relates this table to catalog_product_entity_media_gallery
.
You need to check this table also.
One more table (catalog_product_entity_media_gallery_value_video
) has been introduced in Magento 2, which keeps entries related to product videos.
Please review this table if you have any videos for products.
After the database operation, you can remove the image files from:
pub/media/catalog/product/ folder
pub/media/catalog/product/cache # keeping placeholder folder
That's all.
Note: Keep a backup of the database before doing any exercise on the database.
Apart from:
catalog_product_entity_media_gallery
and
catalog_product_entity_media_gallery_value
tables, now Magento 2 has one more table
catalog_product_entity_media_gallery_value_to_entity
,
which keeps track of removal of product in catalog_product_entity
table, and relates this table to catalog_product_entity_media_gallery
.
You need to check this table also.
One more table (catalog_product_entity_media_gallery_value_video
) has been introduced in Magento 2, which keeps entries related to product videos.
Please review this table if you have any videos for products.
After the database operation, you can remove the image files from:
pub/media/catalog/product/ folder
pub/media/catalog/product/cache # keeping placeholder folder
That's all.
Note: Keep a backup of the database before doing any exercise on the database.
answered Jun 26 at 7:14
Mohit Kumar AroraMohit Kumar Arora
7,3165 gold badges17 silver badges36 bronze badges
7,3165 gold badges17 silver badges36 bronze badges
add a comment |
add a comment |
Based on mohit's answer:
truncate catalog_product_entity_media_gallery_value;
truncate catalog_product_entity_media_gallery_value_to_entity;
delete from catalog_product_entity_media_gallery; # 9 sec
delete from catalog_product_entity_varchar where attribute_id in ( select
attribute_id from eav_attribute where attribute_code like "%image" and
entity_type_id = 4 ); # 23 sec in our case (20000 Products)
add a comment |
Based on mohit's answer:
truncate catalog_product_entity_media_gallery_value;
truncate catalog_product_entity_media_gallery_value_to_entity;
delete from catalog_product_entity_media_gallery; # 9 sec
delete from catalog_product_entity_varchar where attribute_id in ( select
attribute_id from eav_attribute where attribute_code like "%image" and
entity_type_id = 4 ); # 23 sec in our case (20000 Products)
add a comment |
Based on mohit's answer:
truncate catalog_product_entity_media_gallery_value;
truncate catalog_product_entity_media_gallery_value_to_entity;
delete from catalog_product_entity_media_gallery; # 9 sec
delete from catalog_product_entity_varchar where attribute_id in ( select
attribute_id from eav_attribute where attribute_code like "%image" and
entity_type_id = 4 ); # 23 sec in our case (20000 Products)
Based on mohit's answer:
truncate catalog_product_entity_media_gallery_value;
truncate catalog_product_entity_media_gallery_value_to_entity;
delete from catalog_product_entity_media_gallery; # 9 sec
delete from catalog_product_entity_varchar where attribute_id in ( select
attribute_id from eav_attribute where attribute_code like "%image" and
entity_type_id = 4 ); # 23 sec in our case (20000 Products)
answered Jun 28 at 7:58
AlexAlex
9,48417 gold badges56 silver badges118 bronze badges
9,48417 gold badges56 silver badges118 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f279633%2fbulk-remove-all-product-images-from-a-magento-2-shop%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown