{"id":1363,"date":"2020-11-18T12:02:09","date_gmt":"2020-11-18T12:02:09","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2020\/11\/18\/add-custom-mass-action-customer-grid-magento-2\/"},"modified":"2025-07-17T10:22:59","modified_gmt":"2025-07-17T04:52:59","slug":"add-custom-mass-action-customer-grid-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/add-custom-mass-action-customer-grid-magento-2\/","title":{"rendered":"How to Add Custom Mass Action in Customer Grid in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Backend grids in Magento 2 are meant for easy data management.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The mass actions in the admin panel grids allow the admin to perform an action in bulk.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The default customer grid offers multiple mass actions:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/11\/Default-Customer-Grid-1024x448.png\" alt=\"Default-Customer-Grid.png\" class=\"wp-image-11556\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">However, modern business may demand custom actions to be performed on customer data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Today, I\u2019ll show the programmatic solution to&nbsp;<em><strong>add custom mass action in the customer grid in Magento 2<\/strong><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One can use this solution to&nbsp;confirm the registration of customers in bulk or update customers\u2019 data at a time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The default\u00a0Magento 2\u00a0does not have this feature. Therefore, here, I have shared a programmatic solution as shown below:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Add Custom Mass Action in the Customer Grid in Magento 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here is what you need to do.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create file&nbsp;<strong>customer_listing.xml<\/strong>&nbsp;at&nbsp;<strong><em><strong><em>app\\code\\Vendor\\Extension\\view\\adminhtml\\ui_component\\<\/em><\/strong><\/em><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?>\n&lt;listing xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd\">\n    &lt;listingToolbar name=\"listing_top\">\n        &lt;massaction name=\"listing_massaction\">\n            &lt;action name=\"custommassaction\">\n                &lt;settings>\n                    &lt;confirm>\n                        &lt;message translate=\"true\">Are you sure to perform Action for selected customers?&lt;\/message>\n                        &lt;title translate=\"true\">Custom MassAction&lt;\/title>\n                    &lt;\/confirm>\n                    &lt;url path=\"extension\/controller\/massAction\"\/> &lt;!-- your custom controller to handle request -->\n                    &lt;type>custommassaction&lt;\/type>\n                    &lt;label translate=\"true\">Custom MassAction&lt;\/label>\n                &lt;\/settings>\n            &lt;\/action>\n        &lt;\/massaction>\n    &lt;\/listingToolbar>\n&lt;\/listing><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After executing this code, you manage to add custom mass action in the customer grid.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/11\/Annotation-on-2020-11-05-at-13-17-29-1-1024x482.png\" alt=\"How to Add Custom Mass Action in Customer Grid in Magento 2\" class=\"wp-image-11521\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Share this post to Magento Community via social media to bring more awareness about adding custom mass action in the customer grid.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Related Posts:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/meetanshi.com\/blog\/add-custom-mass-action-in-order-grid-in-magento-2\/\">How to Add Mass Custom Action in Order Grid in Magento 2<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/meetanshi.com\/blog\/add-custom-mass-action-in-product-grid-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Add Custom Mass Action to Product Grid In Magento 2<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Backend grids in Magento 2 are meant for easy data management. The mass actions in the admin panel grids allow the admin to perform an&#8230;<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1363","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1363"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1363\/revisions"}],"predecessor-version":[{"id":13931,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1363\/revisions\/13931"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}