Magento: Mass Exclude/Unexclude Images

By default, Magento will check the ‘Exclude’ box for you on all imported images, making them not show up as a thumbnail under the main product image on the product view. Should you ever want to mass unexclude them (or mass exclude your images), you can simply run one of the following sql commands in your database:

# Mass Unexclude
UPDATE`catalog_product_entity_media_gallery_value` SET `disabled` = '0' WHERE `disabled` = '1';
# Mass Exclude
UPDATE`catalog_product_entity_media_gallery_value` SET `disabled` = '1' WHERE `disabled` = '0';
This entry was posted in Magento, MySQL. Bookmark the permalink.

6 Responses to Magento: Mass Exclude/Unexclude Images

  1. ShaggyMax says:

    # Mass Unexclude worked great! Thank you for the excellent tip and time saver!

  2. Thanks so much for this quick fix. Made my day.

  3. B says:

    Thanks for the command however when I check images in Magento Admin, the exclude box is still unticked.

    I’ve checked “catalog_product_entity_media_gallery_value” and disabled is set to 1 on all rows.

    Any ideas?

  4. Yannis says:


    Can you please help me with this command?
    The table “catalog_product_entity_media_gallery_value” has the following fields:
    value_id, store_id, label, position, disabled.
    All fields contain the following query:
    SELECT COUNT( * ) AS `Rows` , `value_id`
    FROM `catalog_product_entity_media_gallery_value`
    GROUP BY `value_id`
    ORDER BY `value_id`
    LIMIT 0 , 30
    Where do I have to put the above mentioned command?

    Thank you

  5. Pingback: Magento: Mass Exclude/Unexclude Images

  6. David says:

    Thanks for the tip and all the other great posts. Just a note the there should be a space between the ‘UPDATE’ and the first ‘`’.