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.
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.
- Open your database and search eav_attribute table.
- In the eav_attribute table, search the color attribute and find column “is_user_defined”.
- Set “is_user_defined” to 0
Now move to the product attribute edit page, and you can see the “Delete Attribute” option is removed.
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.
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
How To Use Class in Root Script in Magento 2
How to Restore Coupon Code after Order Cancellation in Magento 2
Next