{"id":305977,"date":"2021-09-18T07:48:44","date_gmt":"2021-09-18T07:48:44","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=305977"},"modified":"2024-07-24T10:33:08","modified_gmt":"2024-07-24T10:33:08","slug":"create-a-custom-command-to-disable-a-module-in-magento-2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/","title":{"rendered":"Create a custom command to disable a module in Magento 2"},"content":{"rendered":"\n<p>Hello Friends!<br>In this blog, we are going to learn how we can create a custom command to disable a custom module in <a href=\"https:\/\/webkul.com\/blog\/magento-tutorial\/\">Magento 2<\/a> with database changes.<\/p>\n\n\n\n<p>Sometimes, in Magento 2, we create a custom attribute with custom source options, but when we disable the module, we face errors.<\/p>\n\n\n\n<p>So, here we will add functionality to delete required custom attributes, tables, or patch names from the database in our custom command.<\/p>\n\n\n\n<p><br><strong>Note:<\/strong> If you are using Magento version &lt; 2.3, then the patch_list table will not be available in your database.<br><br>To create a custom command, you have to follow below steps:<br><br>1. Mention your command in di.xml file inside app\/code\/Vendor\/CustomModule\/etc\/ directory.<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;!--\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Vendor_CustomModule\n * @author    Webkul &lt;support@webkul.com&gt;\n * @copyright Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html ASL Licence\n * @link      https:\/\/store.webkul.com\/license.html\n *\/\n--&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:ObjectManager\/etc\/config.xsd&quot;&gt;\n    &lt;!--Creating Disable CustomModule Command--&gt;\n    &lt;type name=&quot;Magento\\Framework\\Console\\CommandList&quot;&gt;\n        &lt;arguments&gt;\n            &lt;argument name=&quot;commands&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;disable_custommodule&quot; xsi:type=&quot;object&quot;&gt;Vendor\\CustomModule\\Console\\Command\\DisableCustomModule&lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/arguments&gt;\n    &lt;\/type&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p>2. Now, we will create DisableCustomModule.php file inside app\/code\/Vendor\/CustomModule\/Console\/Command\/ directory. In this Class file, we will extend Symfony\\Component\\Console\\Command\\Command Class and configure our custom command.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Vendor_CustomModule\n * @author    Webkul\n * @copyright Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\nnamespace Vendor\\CustomModule\\Console\\Command;\n\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse Symfony\\Component\\Console\\Input\\InputOption;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n\nclass DisableCustomModule extends Command\n{\n    \/**\n     * @const string\n     *\/\n    const REMOVE = &#039;remove&#039;;\n\n    \/**\n     * @var \\Magento\\Framework\\App\\ResourceConnection\n     *\/\n    protected $resource;\n\n    \/**\n     * @var \\Magento\\Framework\\Module\\Manager\n     *\/\n    protected $moduleManager;\n\n    \/**\n     * @var \\Magento\\Eav\\Model\\ResourceModel\\Entity\\Attribute\n     *\/\n    protected $eavAttribute;\n\n    \/**\n     * @var \\Magento\\Framework\\Module\\Status\n     *\/\n    protected $modStatus;\n\n    \/**\n     * @param \\Magento\\Framework\\App\\ResourceConnection $resource\n     * @param \\Magento\\Framework\\Module\\Manager         $moduleManager\n     * @param \\Magento\\Eav\\Model\\Entity\\Attribute       $entityAttribute\n     * @param \\Magento\\Framework\\Module\\Status          $modStatus\n     *\/\n    public function __construct(\n        \\Magento\\Framework\\Module\\Status $modStatus,\n        \\Magento\\Framework\\Module\\Manager $moduleManager,\n        \\Magento\\Framework\\App\\ResourceConnection $resource,\n        \\Magento\\Eav\\Model\\Entity\\Attribute $entityAttribute\n    ) {\n        $this-&gt;resource      = $resource;\n        $this-&gt;moduleManager = $moduleManager;\n        $this-&gt;eavAttribute  = $entityAttribute;\n        $this-&gt;modStatus     = $modStatus;\n        \n        parent::__construct();\n    }\n\n    \/**\n     * {@inheritdoc}\n     *\/\n    protected function configure()\n    {\n        $options = &#091;\n            new InputOption(\n                self::REMOVE,\n                null,\n                InputOption::VALUE_REQUIRED,\n                &#039;Remove&#039;\n            )\n        ];\n        $this-&gt;setName(&#039;custommodule:disable&#039;)\n            -&gt;setDescription(&#039;CustomModule Disable Command&#039;)\n            -&gt;setDefinition($options);\n        parent::configure();\n    }\n\n    \/**\n     * {@inheritdoc}\n     *\/\n    protected function execute(InputInterface $input, OutputInterface $output)\n    {\n        try {\n            if ($this-&gt;moduleManager-&gt;isEnabled(&#039;Vendor_CustomModule&#039;)) {\n                $connection = $this-&gt;resource\n                    -&gt;getConnection(\\Magento\\Framework\\App\\ResourceConnection::DEFAULT_CONNECTION);\n    \n                \/\/this code will be execute when you will execute command &#039;php bin\/magento custommodule:disable --remove=tables&#039;\n                if ($input-&gt;getOption(self::REMOVE) == &quot;tables&quot;) {\n                    \/\/ drop custom tables\n                    $connection-&gt;dropTable($connection-&gt;getTableName(&#039;custom_table&#039;));\n                    \n                    \/\/ drop custom column from quote_item table\n                    $connection-&gt;dropColumn($connection-&gt;getTableName(&#039;quote_item&#039;), &#039;custom_column&#039;);\n                    \n                    $output-&gt;writeln(&quot;&lt;info&gt;Database Tables Dropped Succesfully.&lt;\/info&gt;&quot;);\n    \n                    $dropColumnsMsg  = &quot;&#039;custom_column&#039; column dropped from quote_item&quot;;\n                    \n                    $output-&gt;writeln($dropColumnsMsg);\n                }\n    \n                \/\/ delete custom_attribute_of_product product attribute\n                $this-&gt;eavAttribute-&gt;loadByCode(&#039;catalog_product&#039;, &#039;custom_attribute_of_product&#039;)-&gt;delete();\n    \n                \/\/ disable CustomModule module\n                $this-&gt;modStatus-&gt;setIsEnabled(false, &#091;&#039;Vendor_CustomModule&#039;]);\n    \n                \/\/ if needed, delete record from patch_list table of CreateCustomAttribute Class\n                $tableName = $connection-&gt;getTableName(&#039;patch_list&#039;);\n                $connection-&gt;delete($tableName, &quot;patch_name = &#039;Vendor\\CustomModule\\Setup\\Patch\\Data\\CreateAttributes&#039;&quot;);\n    \n                \/\/ delete entry from setup_module table\n                $tableName = $connection-&gt;getTableName(&#039;setup_module&#039;);\n                $connection-&gt;delete($tableName, &#091;&quot;module = &#039;Vendor_CustomModule&#039;&quot;]);\n    \n                $output-&gt;writeln(&#039;&lt;info&gt;Vendor_CustomModule module has been disabled successfully.&lt;\/info&gt;&#039;);\n            }\n        } catch (\\Exception $e) {\n            $output-&gt;writeln(&#039;&lt;error&gt;&#039;.$e-&gt;getMessage().&#039;&lt;\/error&gt;&#039;);\n        }\n        \n        return 1;\n    }\n}<\/pre>\n\n\n\n<p>3. After creating the above files. Run the following command on CLI.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento setup:di:compile<\/pre>\n\n\n\n<p>4. Now, we can check our custom command in the command list by executing the following command on CLI.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento list<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"922\" height=\"449\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png\" alt=\"cmdlist1\" class=\"wp-image-305986\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png 922w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1-300x146.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1-250x122.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1-768x374.png 768w\" sizes=\"(max-width: 922px) 100vw, 922px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"232\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist2-1200x232.png\" alt=\"cmdlist2\" class=\"wp-image-305987\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist2-1200x232.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist2-300x58.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist2-250x48.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist2-768x148.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist2.png 1492w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>5. Now, we will run our custom command in CLI.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento custommodule:disable<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1145\" height=\"68\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist4.png\" alt=\"cmdlist4\" class=\"wp-image-305989\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist4.png 1145w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist4-300x18.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist4-250x15.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist4-768x46.png 768w\" sizes=\"(max-width: 1145px) 100vw, 1145px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>6. Now, we will execute our custom command with parameters as following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento custommodule:disable --remove=tables<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"131\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist5-1200x131.png\" alt=\"cmdlist5\" class=\"wp-image-305990\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist5-1200x131.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist5-300x33.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist5-250x27.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist5-768x84.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist5.png 1389w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>7. For more information, <a href=\"https:\/\/devdocs.magento.com\/guides\/v2.4\/extension-dev-guide\/cli-cmds\/cli-howto.html\" target=\"_blank\" rel=\"noreferrer noopener\">check here<\/a>.<br><br>That&#8217;s all about creating a custom command to disable a module in Magento 2.<br><br>Hope this will be helpful. Thanks :),<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello Friends!In this blog, we are going to learn how we can create a custom command to disable a custom module in Magento 2 with database changes. Sometimes, in Magento 2, we create a custom attribute with custom source options, but when we disable the module, we face errors. So, here we will add functionality <a href=\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":249,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121,1743],"tags":[2947,12062,12063],"class_list":["post-305977","post","type-post","status-publish","format-standard","hentry","category-magento-2","category-magento-faq","tag-command","tag-custom-command","tag-disable-command"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create a custom command to disable a module in Magento 2 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Create a custom command to disable a module in Magento 2, how to create a custom command in magento 2, creating custom command\" \/>\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\/create-a-custom-command-to-disable-a-module-in-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create a custom command to disable a module in Magento 2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Create a custom command to disable a module in Magento 2, how to create a custom command in magento 2, creating custom command\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/\" \/>\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=\"2021-09-18T07:48:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-24T10:33:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png\" \/>\n<meta name=\"author\" content=\"Khushboo 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=\"Khushboo 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\/create-a-custom-command-to-disable-a-module-in-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/\"},\"author\":{\"name\":\"Khushboo Sahu\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca\"},\"headline\":\"Create a custom command to disable a module in Magento 2\",\"datePublished\":\"2021-09-18T07:48:44+00:00\",\"dateModified\":\"2024-07-24T10:33:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/\"},\"wordCount\":231,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png\",\"keywords\":[\"command\",\"custom command\",\"disable command\"],\"articleSection\":[\"Magento 2\",\"Magento FAQ\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/\",\"url\":\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/\",\"name\":\"Create a custom command to disable a module in Magento 2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png\",\"datePublished\":\"2021-09-18T07:48:44+00:00\",\"dateModified\":\"2024-07-24T10:33:08+00:00\",\"description\":\"Create a custom command to disable a module in Magento 2, how to create a custom command in magento 2, creating custom command\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png\",\"width\":922,\"height\":449,\"caption\":\"cmdlist1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a custom command to disable a module in Magento 2\"}]},{\"@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\/f94b8f53397bf85810761d76c98fadca\",\"name\":\"Khushboo Sahu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?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\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Khushboo Sahu\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create a custom command to disable a module in Magento 2 - Webkul Blog","description":"Create a custom command to disable a module in Magento 2, how to create a custom command in magento 2, creating custom command","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\/create-a-custom-command-to-disable-a-module-in-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"Create a custom command to disable a module in Magento 2 - Webkul Blog","og_description":"Create a custom command to disable a module in Magento 2, how to create a custom command in magento 2, creating custom command","og_url":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-09-18T07:48:44+00:00","article_modified_time":"2024-07-24T10:33:08+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png","type":"","width":"","height":""}],"author":"Khushboo Sahu","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Khushboo Sahu","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/"},"author":{"name":"Khushboo Sahu","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca"},"headline":"Create a custom command to disable a module in Magento 2","datePublished":"2021-09-18T07:48:44+00:00","dateModified":"2024-07-24T10:33:08+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/"},"wordCount":231,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png","keywords":["command","custom command","disable command"],"articleSection":["Magento 2","Magento FAQ"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/","url":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/","name":"Create a custom command to disable a module in Magento 2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png","datePublished":"2021-09-18T07:48:44+00:00","dateModified":"2024-07-24T10:33:08+00:00","description":"Create a custom command to disable a module in Magento 2, how to create a custom command in magento 2, creating custom command","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/cmdlist1.png","width":922,"height":449,"caption":"cmdlist1"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create a custom command to disable a module in Magento 2"}]},{"@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\/f94b8f53397bf85810761d76c98fadca","name":"Khushboo Sahu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?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\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Khushboo Sahu"},"url":"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305977","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\/249"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=305977"}],"version-history":[{"count":4,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305977\/revisions"}],"predecessor-version":[{"id":454488,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305977\/revisions\/454488"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=305977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=305977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=305977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}