0

Our store has thousands of color attributes and we want to clean out the ones that are old, inactive, or unused. Is there a solution for this? Is there an easy way to see what attributes aren't currently being used?

1 Answer 1

0

There is no easy way which does not include some database poking. If you are ok with using sql queries, then you can do

SELECT `attribute_id` FROM `eav_attribute` ea WHERE ea.`entity_type_id`=4 
AND `attribute_id` NOT IN (SELECT DISTINCT `attribute_id` FROM `catalog_product_entity_int`)
AND `attribute_id` NOT IN (SELECT DISTINCT `attribute_id` FROM `catalog_product_entity_text` )
AND `attribute_id` NOT IN (SELECT DISTINCT `attribute_id` FROM `catalog_product_entity_varchar` )
AND `attribute_id` NOT IN (SELECT DISTINCT `attribute_id` FROM `catalog_product_entity_decimal` )
AND `attribute_id` NOT IN (SELECT DISTINCT `attribute_id` FROM `catalog_product_entity_gallery` )
AND `attribute_id` NOT IN (SELECT DISTINCT `attribute_id` FROM `catalog_product_entity_media_gallery` )
AND `attribute_id` NOT IN (SELECT DISTINCT `attribute_id` FROM `catalog_product_entity_datetime` )

The above will give you unused attributes, however you should not try to directly delete them from database.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.