{"id":38629,"date":"2015-12-30T17:10:15","date_gmt":"2015-12-30T17:10:15","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=38629"},"modified":"2026-02-05T06:01:37","modified_gmt":"2026-02-05T06:01:37","slug":"how-to-add-a-custom-button-in-magento2-admin-grid","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/","title":{"rendered":"How to add a Custom Button in Magento 2 Admin Grid"},"content":{"rendered":"\n<p>Here, you\u2019ll learn how to create and integrate a custom button in the Magento 2 admin grid with clear logic and reusable code.<\/p>\n\n\n\n<p>In the\u00a0<a href=\"http:\/\/webkul.com\/blog\/create-grid-edit-add-grid-row-and-installer-in-magento2\/\" target=\"_blank\" rel=\"noopener noreferrer\">Create Grid , Edit\/Add Grid Row And Installer In Magento 2<\/a> we created an simple Grid module.<\/p>\n\n\n\n<p>Now we are going to add a custom button &#8220;Send Mail&#8221; to custom grid in Magento 2.<\/p>\n\n\n\n<p> On click of the &#8221; Send Mail &#8221; button we will just show a form in popup which will be responsible to send an custom email to customer.<\/p>\n\n\n\n<p>For this we will need to follow some simple steps given below &#8211;<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add&nbsp;customer_listing.xml file to your module in path &#8211; <\/li>\n\n\n\n<li>app\/code\/Webkul\/Grid\/view\/adminhtml\/ui_component\/customer_listing.xml and add a custom button in this file <\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;listing xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd&quot;&gt;\n    &lt;columns name=&quot;customer_columns&quot;&gt;\n        &lt;actionsColumn name=&quot;send_mail&quot; class=&quot;Webkul\\Grid\\Ui\\Component\\Listing\\Columns\\Sendmail&quot;&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;component&quot; xsi:type=&quot;string&quot;&gt;Webkul_Grid\/js\/grid\/columns\/sendmail&lt;\/item&gt;\n                    &lt;item name=&quot;indexField&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/item&gt;\n                    &lt;item name=&quot;sortable&quot; xsi:type=&quot;boolean&quot;&gt;false&lt;\/item&gt;\n                    &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Send Mail&lt;\/item&gt;\n                    &lt;item name=&quot;sortOrder&quot; xsi:type=&quot;number&quot;&gt;13&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/actionsColumn&gt;\n    &lt;\/columns&gt;\n&lt;\/listing&gt;<\/pre>\n\n\n\n<p>3. As we want to show an form on click on this custom &#8220;Send Mail&#8221; button , now we need to create a ui component class&nbsp;Webkul\\Grid\\Ui\\Component\\Listing\\Columns\\Sendmail &#8211; <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\nnamespace Webkul\\Grid\\Ui\\Component\\Listing\\Columns;\n\nuse Magento\\Framework\\UrlInterface;\nuse Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface;\nuse Magento\\Framework\\View\\Element\\UiComponentFactory;\nuse Magento\\Ui\\Component\\Listing\\Columns\\Column;\n\nclass Sendmail extends Column\n{\n    \/**\n     *@var UrlInterface\n     *\/\n    protected $urlBuilder;\n    \/**\n     * Constructor\n     *\n     * @param ContextInterface $context\n     * @param UiComponentFactory $uiComponentFactory\n     * @param UrlInterface $urlBuilder\n     * @param array $components\n     * @param array $data      \n     *\/\n    public function __construct(\n        ContextInterface $context,\n        UiComponentFactory $uiComponentFactory,\n        UrlInterface $urlBuilder,\n        array $components = &#091;],\n        array $data = &#091;]\n    ) {\n        $this-&gt;urlBuilder = $urlBuilder;\n        parent::__construct($context, $uiComponentFactory, $components, $data);\n    }\n    \/**      \n     * Prepare Data Source\n     * \n     * @param array $dataSource\n     * @return array\n     *\/\n    public function prepareDataSource(array $dataSource)\n    {\n        if (isset($dataSource&#091;&#039;data&#039;]&#091;&#039;items&#039;])) {\n            $fieldName = $this-&gt;getData(&#039;name&#039;);\n            foreach ($dataSource&#091;&#039;data&#039;]&#091;&#039;items&#039;] as &amp;$item) {\n                $item&#091;$fieldName . &#039;_html&#039;] = &quot;&lt;button class=&#039;button&#039;&gt;&lt;span&gt;Send Mail&lt;\/span&gt;&lt;\/button&gt;&quot;;\n                $item&#091;$fieldName . &#039;_title&#039;] = __(&#039;Please enter a message that you want to send to customer&#039;);\n                $item&#091;$fieldName . &#039;_submitlabel&#039;] = __(&#039;Send&#039;);\n                $item&#091;$fieldName . &#039;_cancellabel&#039;] = __(&#039;Reset&#039;);\n                $item&#091;$fieldName . &#039;_customerid&#039;] = $item&#091;&#039;entity_id&#039;];\n                $item&#091;$fieldName . &#039;_formaction&#039;] = $this-&gt;urlBuilder-&gt;getUrl(&#039;grid\/customer\/sendmail&#039;);\n            }\n        }\n        return $dataSource;\n    }\n}<\/pre>\n\n\n\n<p>4. Now we will need to create a js file sendmail.js at below <br>path.<\/p>\n\n\n\n<p>app\/code\/Webkul\/Grid\/view\/base\/web\/js\/grid\/columns\/ which we are using in this custom button. <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">define(\n    &#091;&#039;Magento_Ui\/js\/grid\/columns\/column&#039;,\n        &#039;jquery&#039;, &#039;mage\/template&#039;,\n        &#039;text!Webkul_Grid\/templates\/grid\/cells\/customer\/sendmail.html&#039;,\n        &#039;Magento_Ui\/js\/modal\/modal&#039;], function (Column, $, mageTemplate, sendmailPreviewTemplate) {\n            &#039;use strict&#039;; return Column.extend({\n                defaults: {\n                    bodyTmpl: &#039;ui\/grid\/cells\/html&#039;,\n                    fieldClass: { &#039;data-grid-html-cell&#039;: true }\n                },\n                gethtml: function (row) {\n                    return row&#091;this.index + &#039;_html&#039;];\n                },\n                getFormaction: function (row) {\n                    return row&#091;this.index + &#039;_formaction&#039;];\n                },\n                getCustomerid: function (row) {\n                    return row&#091;this.index + &#039;_customerid&#039;];\n                },\n                getLabel: function (row) { return row&#091;this.index + &#039;_html&#039;] },\n                getTitle: function (row) { return row&#091;this.index + &#039;_title&#039;] },\n                getSubmitlabel: function (row) { return row&#091;this.index + &#039;_submitlabel&#039;] },\n                getCancellabel: function (row) { return row&#091;this.index + &#039;_cancellabel&#039;] },\n                preview: function (row) {\n                    var modalHtml = mageTemplate(sendmailPreviewTemplate, {\n                        html: this.gethtml(row),\n                        title: this.getTitle(row),\n                        label: this.getLabel(row),\n                        formaction: this.getFormaction(row),\n                        customerid: this.getCustomerid(row),\n                        submitlabel: this.getSubmitlabel(row),\n                        cancellabel: this.getCancellabel(row),\n                        linkText: $.mage.__(&#039;Go to Details Page&#039;)\n                    });\n                    var previewPopup = $(&#039;&lt;div\/&gt;&#039;).html(modalHtml);\n                    previewPopup.modal({\n                        title: this.getTitle(row),\n                        innerScroll: true, modalClass: &#039;_image-box&#039;,\n                        buttons: &#091;]\n                    }).trigger(&#039;openModal&#039;);\n                },\n                getFieldHandler: function (row) { return this.preview.bind(this, row); }\n            });\n        });<\/pre>\n\n\n\n<p>5. Now we have to create a template file sendmail.html in path app\/code\/Webkul\/Grid\/view\/base\/web\/templates\/grid\/cells\/customer\/ .<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;form id=&quot;send-mail-form-&lt;%- customerid %&gt;&quot; method=&quot;get&quot; enctype=&quot;multipart\/form-data&quot; action=&quot;&lt;%- formaction %&gt;&quot;&gt;\n    &lt;div class=&quot;modal-body&quot;&gt;\n        &lt;div class=&quot;bootbox-body&quot;&gt; &lt;textarea class=&quot;bootbox-input bootbox-input-text form-control required-entry&quot;\n                name=&quot;send_message&quot; rows=&quot;4&quot; cols=&quot;83&quot;&gt;&lt;\/textarea&gt; &lt;input type=&quot;hidden&quot; name=&quot;entity_id&quot;\n                value=&quot;&lt;%- customerid %&gt;&quot;&gt; &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;modal-footer&quot;&gt; &lt;span class=&quot;error&quot;&gt;&lt;\/span&gt; &lt;button type=&quot;reset&quot; class=&quot;btn btn-default&quot;&gt;&lt;span&gt;&lt;%-\n                    cancellabel %&gt;&lt;\/span&gt;&lt;\/button&gt; &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;&lt;span&gt;&lt;%- submitlabel\n                    %&gt;&lt;\/span&gt;&lt;\/button&gt; &lt;span class=&quot;clear&quot;&gt;&lt;\/span&gt; &lt;\/div&gt;\n&lt;\/form&gt;<\/pre>\n\n\n\n<p>now you will see a custom button &#8220;Send Mail&#8221; is added in the magento2 customer grid as shown in the given screenshot-<img decoding=\"async\" width=\"1196\" height=\"589\" class=\"alignnone size-full wp-image-38642\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png\" alt=\"custom_button\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png 1196w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button-250x123.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button-300x148.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button-768x378.png 768w\" sizes=\"(max-width: 1196px) 100vw, 1196px\" loading=\"lazy\" \/>on click on &#8220;Send Mail&#8221; button you will see a form in popup which will be responsible to send a custom mail to customer.<img decoding=\"async\" width=\"1206\" height=\"399\" class=\"alignnone size-full wp-image-38641\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/sendmail.png\" alt=\"sendmail\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/sendmail.png 1206w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/sendmail-250x83.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/sendmail-300x99.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/sendmail-768x254.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2015\/12\/sendmail-1200x397.png 1200w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" loading=\"lazy\" \/>So in this way you can add any custom button or any custom column like action link, image to any grid in magento2.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>How to add a custom button in magento2 admin grid<\/p>\n\n\n\n<p>You can also check the links below : <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.adobe.com\/commerce\/php\/development\/components\/add-admin-grid\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/developer.adobe.com\/commerce\/php\/development\/components\/add-admin-grid\/<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Here, you\u2019ll learn how to create and integrate a custom button in the Magento 2 admin grid with clear logic and reusable code. In the\u00a0Create Grid , Edit\/Add Grid Row And Installer In Magento 2 we created an simple Grid module. Now we are going to add a custom button &#8220;Send Mail&#8221; to custom grid <a href=\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[2056,2070],"class_list":["post-38629","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-magento","tag-magento2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to add a custom button in Magento 2 Admin Grid<\/title>\n<meta name=\"description\" content=\"Here We covered complete process of adding a custom button to Magento 2 admin grid, ensuring flexibility and better admin control.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add a custom button in Magento 2 Admin Grid\" \/>\n<meta property=\"og:description\" content=\"Here We covered complete process of adding a custom button to Magento 2 admin grid, ensuring flexibility and better admin control.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-30T17:10:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-05T06:01:37+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png\" \/>\n<meta name=\"author\" content=\"Pooja Sahu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pooja Sahu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/\"},\"author\":{\"name\":\"Pooja Sahu\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/420601cccfd5bc83506bcdd12362504b\"},\"headline\":\"How to add a Custom Button in Magento 2 Admin Grid\",\"datePublished\":\"2015-12-30T17:10:15+00:00\",\"dateModified\":\"2026-02-05T06:01:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/\"},\"wordCount\":319,\"commentCount\":11,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png\",\"keywords\":[\"magento\",\"Magento2\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/\",\"name\":\"How to add a custom button in Magento 2 Admin Grid\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png\",\"datePublished\":\"2015-12-30T17:10:15+00:00\",\"dateModified\":\"2026-02-05T06:01:37+00:00\",\"description\":\"Here We covered complete process of adding a custom button to Magento 2 admin grid, ensuring flexibility and better admin control.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#primaryimage\",\"url\":\"http:\/\/webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png\",\"contentUrl\":\"http:\/\/webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add a Custom Button in Magento 2 Admin Grid\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/420601cccfd5bc83506bcdd12362504b\",\"name\":\"Pooja Sahu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/87f400f19d2c602040b38dc2db6412c18f8c1ee7405e40a06bf4a21f24ea12c7?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/87f400f19d2c602040b38dc2db6412c18f8c1ee7405e40a06bf4a21f24ea12c7?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Pooja Sahu\"},\"description\":\"Pooja Sahu is an Adobe Certified Professional &ndash; Developer in the Magento department, with expertise in HTML, CSS, JavaScript, MySQL, eCommerce platform development, and PWA. Her skills drive innovative solutions and enhance user experiences across various platforms.\",\"url\":\"https:\/\/webkul.com\/blog\/author\/pooja\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add a custom button in Magento 2 Admin Grid","description":"Here We covered complete process of adding a custom button to Magento 2 admin grid, ensuring flexibility and better admin control.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/","og_locale":"en_US","og_type":"article","og_title":"How to add a custom button in Magento 2 Admin Grid","og_description":"Here We covered complete process of adding a custom button to Magento 2 admin grid, ensuring flexibility and better admin control.","og_url":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2015-12-30T17:10:15+00:00","article_modified_time":"2026-02-05T06:01:37+00:00","og_image":[{"url":"http:\/\/webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png","type":"","width":"","height":""}],"author":"Pooja Sahu","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Pooja Sahu","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/"},"author":{"name":"Pooja Sahu","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/420601cccfd5bc83506bcdd12362504b"},"headline":"How to add a Custom Button in Magento 2 Admin Grid","datePublished":"2015-12-30T17:10:15+00:00","dateModified":"2026-02-05T06:01:37+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/"},"wordCount":319,"commentCount":11,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#primaryimage"},"thumbnailUrl":"http:\/\/webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png","keywords":["magento","Magento2"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/","url":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/","name":"How to add a custom button in Magento 2 Admin Grid","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#primaryimage"},"thumbnailUrl":"http:\/\/webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png","datePublished":"2015-12-30T17:10:15+00:00","dateModified":"2026-02-05T06:01:37+00:00","description":"Here We covered complete process of adding a custom button to Magento 2 admin grid, ensuring flexibility and better admin control.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#primaryimage","url":"http:\/\/webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png","contentUrl":"http:\/\/webkul.com\/blog\/wp-content\/uploads\/2015\/12\/custom_button.png"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-add-a-custom-button-in-magento2-admin-grid\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to add a Custom Button in Magento 2 Admin Grid"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/420601cccfd5bc83506bcdd12362504b","name":"Pooja Sahu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/87f400f19d2c602040b38dc2db6412c18f8c1ee7405e40a06bf4a21f24ea12c7?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/87f400f19d2c602040b38dc2db6412c18f8c1ee7405e40a06bf4a21f24ea12c7?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Pooja Sahu"},"description":"Pooja Sahu is an Adobe Certified Professional &ndash; Developer in the Magento department, with expertise in HTML, CSS, JavaScript, MySQL, eCommerce platform development, and PWA. Her skills drive innovative solutions and enhance user experiences across various platforms.","url":"https:\/\/webkul.com\/blog\/author\/pooja\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/38629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=38629"}],"version-history":[{"count":11,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/38629\/revisions"}],"predecessor-version":[{"id":524960,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/38629\/revisions\/524960"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=38629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=38629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=38629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}