Hello Magento Friends,

The current tutorial is about removing the “delete” mass action from the admin product grid in Magento 2. We will be performing the steps programmatically. Before starting let’s understand about delete action.

Magento 2 admin grid allows managing products and applying various bulk actions on them. One of the mass actions is “delete”. Look at the below image

with delete option

Admin users can delete multiple products at a time. But if you want to remove the “Delete” option from the mass action for admin users, you can achieve it programmatically in Magento 2.

Steps to Remove “Delete” Mass Action from Product Grid Programmatically in Magento 2:

Step 1:  We need to create a “di.xml” file inside our extension at the following path

app\code\Vendor\Extension\etc\adminhtml\

Then add the following code

Step 2:  After that, we need to create a “MassAction.php” file inside our extension at the following path

app\code\Vendor\Extension\Plugin\Catalog\Ui\Component\Product\

Then add the code mentioned below

Result:

Check your Magento 2 product grid from the admin panel. You can see the “delete” option has been removed from the mass actions.

without delete option

Conclusion:

This way you can successfully erase the “delete” action from the admin product grid in Magento 2. In case you are unable to achieve the desired result, get in touch with me through the comment box. I will be happy to help you.

You can also add a custom mass action to the product grid in Magento 2. Also, track all the activities performed by your admin users by installing Magento 2 Admin Action Log.

Share the article with your friends and stay updated with the latest articles.

Happy Coding!

Click to rate this post!
[Total: 4 Average: 3]