{"id":1016,"date":"2020-05-23T11:19:30","date_gmt":"2020-05-23T11:19:30","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2020\/05\/23\/add-custom-mass-action-in-order-grid-in-magento-2\/"},"modified":"2026-01-07T15:51:48","modified_gmt":"2026-01-07T10:21:48","slug":"add-custom-mass-action-in-order-grid-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/add-custom-mass-action-in-order-grid-in-magento-2\/","title":{"rendered":"How to Add Custom Mass Action in Order Grid in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The admin grids in Magento 2 backend are an easy way to manage data, sort, edit, filter, or delete it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The admin grids are well-equipped with mass actions such as Cancel, Print, Delete, etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The default Magento 2 order grid mass action looks something like this:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/05\/Default-Magento-2-Order-Grid-Mass-Action.png\" alt=\"Default Magento 2 Order Grid Mass Action\" class=\"wp-image-9039\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">However, increasing business innovations and urgency to complete the task lists have compelled the developers to customize the admin grids and add mass actions to get things done quickly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Talking about the standard Magento 2 order grid, it\u2019s mass actions is pretty much enough for basic order management tasks. But we are not satisfied with the basics, are we!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore, I\u2019ve come up with a programmatic solution to&nbsp;<em><strong>add custom mass action in order grid in Magento 2<\/strong><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Adding <a href=\"https:\/\/meetanshi.com\/blog\/add-custom-mass-action-customer-grid-magento-2\/\" data-type=\"link\" data-id=\"https:\/\/meetanshi.com\/blog\/add-custom-mass-action-customer-grid-magento-2\/\">custom mass action in Magento 2<\/a> order grid will allow the store admins to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Process orders efficiently<\/li>\n\n\n\n<li>Convenience in order management<\/li>\n\n\n\n<li>More work, less time<\/li>\n\n\n\n<li>Less dependency on the developers<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Using Magento 2 UI components, one can add new mass action to the existing order grid in Magento 2 as shown below:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Add Custom Mass Action in Order Grid in Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create&nbsp;<em><strong>sales_order_grid.xml<\/strong><\/em>&nbsp;file at&nbsp;<strong><strong>app\\code\\Vendor\\Extension\\view\\adminhtml\\ui_component\\<\/strong><\/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=\"mass_order_custom_action\">\n                &lt;argument name=\"data\" xsi:type=\"array\">\n                    &lt;item name=\"config\" xsi:type=\"array\">\n                        &lt;item name=\"type\" xsi:type=\"string\">order_custom_action&lt;\/item>\n                        &lt;item name=\"label\" xsi:type=\"string\" translate=\"true\">Custom Mass Action&lt;\/item>\n                        &lt;item name=\"url\" xsi:type=\"url\" path=\"fourth\/index\/\"\/>\n                    &lt;\/item>\n                &lt;\/argument>\n            &lt;\/action>\n        &lt;\/massaction>\n    &lt;\/listingToolbar>\n&lt;\/listing><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is an example to add \u201cPrint Order Preparation\u201d mass action in the order grid as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/05\/Custom-Mass-Action-in-Magento-2-Order-grid-Meetanshi-1024x499.jpg\" alt=\"Custom Mass Action in Magento 2 Order grid - Meetanshi\" class=\"wp-image-9040\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can refer the same for adding custom mass actions to order grid as per your Magento 2 project requirements!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, do share this useful solution with Magento 2 store admins and developers via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n\n\n<div class=\"meetanshi-cta\">\r\n\r\n<div class=\"cta-content-wrapper\">\r\n\r\n<span>Stop Processing Orders One by One<\/span>\r\n\r\n<p>Updating statuses, generating invoices, and printing shipping labels for hundreds of orders in a single click.<\/p>\r\n\r\n<a href=\"https:\/\/meetanshi.com\/magento-2-mass-order-actions.html\" target=\"_blank\" class=\"btn-primary\">Update Now<\/a>\r\n\r\n<\/div>\r\n\r\n<div class=\"cta-image-new\">\r\n\r\n<img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2026\/01\/Mass-Order-Actions.png\" alt=\"Magento 2 Mass Order Actions\">\r\n\r\n<\/div>\r\n\r\n<\/div>\r\n\r\n\r\n\r\n\n","protected":false},"excerpt":{"rendered":"<p>The admin grids in Magento 2 backend are an easy way to manage data, sort, edit, filter, or delete it. The admin grids are well-equipped&#8230;<\/p>\n","protected":false},"author":13,"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-1016","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1016","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\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1016"}],"version-history":[{"count":6,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1016\/revisions"}],"predecessor-version":[{"id":25332,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1016\/revisions\/25332"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}