8

How do you delete created product attributes in Magento 2?

I can't get rid of it. I have couple of Magento product attributes which not needed

2
  • customer attribute or product attribute ? – Manashvi Birla Apr 13 '16 at 11:10
  • product attributes – fefe Apr 13 '16 at 11:14
1

You can delete product attributes from below steps: Go to Admin, click on menu

Stores -> Product

You have display list of product attributes. Now click on attributes you want to delete, new attribute page will display, click on delete attribute button to delete. Thanks.

2
  • What if the attribute was added by an extension? Is there a way to remove it in Admin? – Jānis Elmeris Nov 10 '17 at 8:17
  • If attribute created by an extension is considered as system attribute then there is no way to remove it from admin. – Bijal Bhavsar Apr 3 '19 at 5:53
18

If you do not see the delete attribute button then that means the table column 'is_user_defined' in the eav_attribute table is set to 0. By changing this to 1 it will show the delete button.

If you do not know where to go to find the attribute then you can follow the answers. In the admin Stores->Attributes->Products

3

You can remove unused product attributes in Magento 2 by using command line as well.

php bin/magento catalog:product:attributes:cleanup

Sees more details command line catalog:product:attributes:cleanup by using command line help or option -h:

php bin/magento help catalog:product:attributes:cleanup

OR use

php bin/magento catalog:product:attributes:cleanup -h

Let me know if you still have any issue.

2

If it's Product attributes Navigation in admin for delete Stores->Attributes click on Products here you can see all attributes just click on your select attribute and click on delete attribute button.

2

The eav_attribute table set from 0 to 1 worked perfectly. I had migrated from Magento 1 and had all these left over attributes that needed to be removed but I could not because when they were migrated they treated those attributes like system attributes and therefore could not delete.

That last comment changing the eav_attribute did the trick. Thanks.

0

In order to delete product attribute from backend navigate to

Stores -> Attributes -> Product

click on desired attribute and in next page you will see Delete Attribute button in the top bar, click on it to delete attribute.

If you do not see the delete attribute button then it means the table column 'is_user_defined' in the eav_attribute table is set to 0. By changing this to 1 it will show the delete button.

If you had migrated from Magento 1 then this attributes were considered as system attributes and therefore no delete attribute button is displayed in backend.

Run below query in database to set this value for multiple attributes

UPDATE `eav_attribute` SET `is_user_defined` = 1 WHERE attribute_code IN ('attribute_1','attribute_2');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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