How to Remove “Delete Attribute” Option from Product Attribute in Magento 2

How to Remove "Delete Attribute" Option From Product Attribute in Magento 2

Being a store owner, you may have leveraged default product attributes or created product attributes in Magento 2 to address product specific needs.

In most of the cases, a store is administered by multiple users by allowing multiple admin login in Magento 2 and there may be the chances of deleting some products, categories, product attributes or any important functionality by mistake by any of the admin users. To avoid the same, the admin may want to remove “Delete Attribute” option from Product Attribute in Magento 2.

How to Remove "Delete Attribute" Option from Product Attribute in Magento 2 1

 

The default Magento 2 does not allow to remove the “Delete Attribute” option from the product attribute. And thus, the post explains stepwise method to remove “Delete Attribute” option from product attribute in Magento 2.

Stepwise Method to Remove “Delete Attribute” Option from Product Attribute in Magento 2

Let’s say, you have created a product attribute named “Color” and you want to remove the “Delete Attribute” for the same. Follow the below steps to remove “Delete Attribute” option for the color product attribute.

  1. Open your database and search eav_attribute table.
  2. In the eav_attribute table, search the color attribute and find column “is_user_defined”.
  3. Set “is_user_defined” to 0Remove "Delete Attribute" Option from Product Attribute in Magento 2

Now move to the product attribute edit page, and you can see the “Delete Attribute” option is removed.

Remove "Delete Attribute" Option from Product Attribute in Magento 2

Done. Removing the “Delete Attribute” option from product attribute will no longer allow anyone to delete the attribute.

Having a query? Feel free to ask in the Comment section below.

I would be happy to answer.

Do consider sharing the post with Magento Community via social media.

Thank you.

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

5
(based on 10 Reviews)

Kanchi is a Magento Developer at Meetanshi. Apart from that, she is into dancing. In her free time, she likes to make handmade art and craft.

Leave a reply:

Your email address will not be published.