Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Delete all unused attribute options. 
 
devces
Jr. Member
 
Total Posts:  4
Joined:  2011-07-27
 

So during the initial testing / integration effort many attributes were added.  I find these to be a nuisance in the catalog and a complete waste of space.  Does anyone have advice on how to delete all unused attributes that exist?  I am thinking some sql can do the trick but am not comfortable with the eav architect yet. 

-devces

 
Magento Community Magento Community
Magento Community
Magento Community
 
jjbigfish
Sr. Member
 
Total Posts:  109
Joined:  2010-01-30
 

You can manage the attribute in the backend of Magento. Under the catalog tab, manage attributes.

 
Magento Community Magento Community
Magento Community
Magento Community
 
devces
Jr. Member
 
Total Posts:  4
Joined:  2011-07-27
 

While this would work. I have about 50+ dropdown menus some that have over 200 options and need something robust to clean up the noise of unused ones.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

Let us know how the SQL stuff goes. Just make several good backups as this can cause some pretty intense database corruption if you get it wrong.

 
Magento Community Magento Community
Magento Community
Magento Community
 
devces
Jr. Member
 
Total Posts:  4
Joined:  2011-07-27
 

What am I missing here?

delete eaov
from eav_attribute_option_value eaov
inner join eav_attribute_option eao on eaov
.option_id eao.option_id
inner join eav_attribute ea on ea
.attribute_id eao.attribute_id
left join catalog_product_index_eav ce 
    on ce
.attribute_id ea.attribute_id  and ce.value eaov.option_id
where ce
.entity_id is null
 
Magento Community Magento Community
Magento Community
Magento Community
 
Wielen
Sr. Member
 
Total Posts:  95
Joined:  2009-01-28
 
devces - 28 July 2011 02:28 PM

What am I missing here?

delete eaov
from eav_attribute_option_value eaov
inner join eav_attribute_option eao on eaov
.option_id eao.option_id
inner join eav_attribute ea on ea
.attribute_id eao.attribute_id
left join catalog_product_index_eav ce 
    on ce
.attribute_id ea.attribute_id  and ce.value eaov.option_id
where ce
.entity_id is null

When i use this queury in MySQL i am getting the following error:

1054 - Unknown column ‘c’ in ‘field list’

What am i doing wrong?

Cheers,

Jord

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top