{"id":42925,"date":"2016-03-10T10:58:27","date_gmt":"2016-03-10T10:58:27","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=42925"},"modified":"2024-03-04T07:13:12","modified_gmt":"2024-03-04T07:13:12","slug":"how-to-create-custom-command-to-delete-order-in-magento2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/","title":{"rendered":"How to create custom command to delete order in magento2"},"content":{"rendered":"\n<p>How to create custom command to delete order in magento2 &#8211; In Magento 2 &nbsp;you can create your own custom command for any action. As magento doesn&#8217;t allow to delete order from admin dashboard then in this case there comes a need for how to delete orders. So here using this post I am going to explain how to create your own custom command for deleting magento order.<\/p>\n\n\n\n<p>For this you just need to follow some easy steps-<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a Command class in the path&lt;module_dir&gt;\/Console\/Command (As recommended by magento), like here I am using the path app\/code\/Webkul\/CustomCommand\/Console\/Command <\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\">namespace Webkul\\CustomCommand\\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;\nuse Magento\\Sales\\Model\\Order;\nuse Magento\\Framework\\Registry;\n\n\/**\n * Class OrderDeleteCommand\n *\/\nclass OrderDeleteCommand extends Command\n{\n    \/**\n     * Order argument\n     *\/\n    const ORDER_ARGUMENT = &#039;order_id&#039;;\n\n    \/**\n     * Allow all\n     *\/\n    const ALLOW_ALL = &#039;allow-all&#039;;\n\n    \/**\n     * All order id\n     *\/\n    const ALL_ORDER = &#039;All&#039;;\n\n    \/**\n     * Order\n     *\n     * @var Order\n     *\/\n    private $order;\n\n    \/**\n     * @var \\Magento\\Sales\\Model\\ResourceModel\\Order\\CollectionFactory\n     *\/\n    protected $orderCollectionFactory;\n\n    \/**\n     * @var \\Magento\\Framework\\Registry\n     *\/\n    protected $registry;\n\n    \/**\n     * @param ModuleListInterface $moduleList\n     *\/\n    public function __construct(\n        Order $order,\n        \\Magento\\Sales\\Model\\ResourceModel\\Order\\CollectionFactory $orderCollectionFactory,\n        Registry $registry\n    )\n    {\n        $this-&gt;order = $order;\n        $this-&gt;registry = $registry;\n        $this-&gt;orderCollectionFactory = $orderCollectionFactory;\n        parent::__construct();\n    }\n\n    \/**\n     * {@inheritdoc}\n     *\/\n    protected function configure()\n    {\n        $this-&gt;setName(&#039;webkul:orderDelete&#039;)\n            -&gt;setDescription(&#039;Order Delete command&#039;)\n            -&gt;setDefinition(&#091;\n                new InputArgument(\n                    self::ORDER_ARGUMENT,\n                    InputArgument::OPTIONAL,\n                    &#039;OrderId&#039;\n                ),\n                new InputOption(\n                    self::ALLOW_ALL,\n                    &#039;-a&#039;,\n                    InputOption::VALUE_NONE,\n                    &#039;Allow all OrderId&#039;\n                ),\n\n            ]);\n\n        parent::configure();\n    }\n\n    \/**\n     * {@inheritdoc}\n     *\/\n    protected function execute(InputInterface $input, OutputInterface $output)\n    {\n        $orderId = $input-&gt;getArgument(self::ORDER_ARGUMENT);\n        $allowAll = $input-&gt;getOption(self::ALLOW_ALL);\n        if (is_null($orderId)) {\n            if ($allowAll) {\n                $this-&gt;registry-&gt;register(&#039;isSecureArea&#039;,&#039;true&#039;);         \/\/create secure area to delete orders\n                $orderAllColl = $this-&gt;orderCollectionFactory-&gt;create();  \/\/Get Order Collection\n                foreach ($orderAllColl as $orderCollData) {\n                    $orderCollData-&gt;delete();                             \/\/Delete Order\n                }\n                $this-&gt;registry-&gt;unregister(&#039;isSecureArea&#039;);              \/\/unset secure area\n                $output-&gt;writeln(&#039;&lt;info&gt;All orders are deleted.&lt;\/info&gt;&#039;); \/\/Displaying output on terminal\n            } else {\n                throw new \\InvalidArgumentException(&#039;Argument &#039; . self::ORDER_ARGUMENT . &#039; is missing.&#039;);\n            }\n        }\n        if($orderId){\n            $orderColl = $this-&gt;order-&gt;load($orderId);\n            if(empty($orderColl) || !$orderColl-&gt;getId()){\n                $output-&gt;writeln(&#039;&lt;info&gt;Order with id &#039; . $orderId . &#039; does not exist.&lt;\/info&gt;&#039;);\n            }else{\n                $this-&gt;registry-&gt;register(&#039;isSecureArea&#039;,&#039;true&#039;);         \/\/create secure area to delete orders\n                $orderColl-&gt;delete();                                     \/\/Delete Order\n                $this-&gt;registry-&gt;unregister(&#039;isSecureArea&#039;);              \/\/unset secure area\n                $output-&gt;writeln(&#039;&lt;info&gt;Order with id &#039; . $orderId . &#039; is deleted.&lt;\/info&gt;&#039;);\n            }\n        }\n    }\n}<\/pre>\n\n\n\n<p>2. Declaration of Command class in <code>Magento\\Framework\\Console\\CommandList<\/code> using dependency injection in file path &#8220;app\/code\/Webkul\/CustomCommand\/di.xml&#8221; <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&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;order_delete_command&quot; xsi:type=&quot;object&quot;&gt;Webkul\\CustomCommand\\Console\\Command\\OrderDeleteCommand&lt;\/item&gt;\n        &lt;\/argument&gt;\n    &lt;\/arguments&gt;\n&lt;\/type&gt;<\/pre>\n\n\n\n<p>3. Now clear the cache and compile the module.<\/p>\n\n\n\n<p>4. Now run the following command to check the working process of this commands-<br>php bin\/magento \u2013list<br>now you will see the custom created command as shown in the given screenshot<\/p>\n\n\n\n<p><img decoding=\"async\" width=\"897\" height=\"376\" class=\"alignnone size-full wp-image-42933\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/KqikiDw.png\" alt=\"KqikiDw\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/KqikiDw.png 897w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/KqikiDw-250x105.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/KqikiDw-300x126.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/KqikiDw-768x322.png 768w\" sizes=\"(max-width: 897px) 100vw, 897px\" loading=\"lazy\" \/><br>Now run command &#8211; php bin\/magento webkul:orderDelete 1 to delete order with order id 1 through command line. <img decoding=\"async\" width=\"837\" height=\"39\" class=\"alignnone size-full wp-image-42934\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/gj7sQbz.png\" alt=\"gj7sQbz\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/gj7sQbz.png 837w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/gj7sQbz-250x12.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/gj7sQbz-300x14.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/gj7sQbz-768x36.png 768w\" sizes=\"(max-width: 837px) 100vw, 837px\" loading=\"lazy\" \/>For deleting all orders just run the command &#8211; php bin\/magento webkul:orderDelete -a<img decoding=\"async\" width=\"914\" height=\"53\" class=\"alignnone size-full wp-image-42935\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/erLlIh0.png\" alt=\"erLlIh0\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/erLlIh0.png 914w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/erLlIh0-250x14.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/erLlIh0-300x17.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/03\/erLlIh0-768x45.png 768w\" sizes=\"(max-width: 914px) 100vw, 914px\" loading=\"lazy\" \/><\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<p>So in this way you can create your own custom commands for any action.<\/p>\n\n\n\n<p>For complete module please find at&nbsp;<a href=\"https:\/\/github.com\/webkul\/magento2-custom-command\">https:\/\/github.com\/webkul\/magento2-custom-command<\/a> .<\/p>\n\n\n\n<p>You can also check the below links:<\/p>\n\n\n\n<p><a href=\"https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/\">https:\/\/webkul.com\/blog\/create-a-custom-command-to-disable-a-module-in-magento-2\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/devdocs.magento.com\/guides\/v2.3\/config-guide\/cli\/config-cli.html\">https:\/\/devdocs.magento.com\/guides\/v2.3\/config-guide\/cli\/config-cli.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to create custom command to delete order in magento2 &#8211; In Magento 2 &nbsp;you can create your own custom command for any action. As magento doesn&#8217;t allow to delete order from admin dashboard then in this case there comes a need for how to delete orders. So here using this post I am going <a href=\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":15,"featured_media":39266,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[6461,353,7321,2070,312],"class_list":["post-42925","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento2","tag-commands","tag-custom","tag-delete","tag-magento2","tag-order"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to create custom command to delete order in magento2 - Webkul Blog<\/title>\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-create-custom-command-to-delete-order-in-magento2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create custom command to delete order in magento2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"How to create custom command to delete order in magento2 &#8211; In Magento 2 &nbsp;you can create your own custom command for any action. As magento doesn&#8217;t allow to delete order from admin dashboard then in this case there comes a need for how to delete orders. So here using this post I am going [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/\" \/>\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=\"2016-03-10T10:58:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-04T07:13:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/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-create-custom-command-to-delete-order-in-magento2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/\"},\"author\":{\"name\":\"Pooja Sahu\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/420601cccfd5bc83506bcdd12362504b\"},\"headline\":\"How to create custom command to delete order in magento2\",\"datePublished\":\"2016-03-10T10:58:27+00:00\",\"dateModified\":\"2024-03-04T07:13:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/\"},\"wordCount\":254,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-2.png\",\"keywords\":[\"commands\",\"Custom\",\"delete\",\"Magento2\",\"order\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/\",\"name\":\"How to create custom command to delete order in magento2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-2.png\",\"datePublished\":\"2016-03-10T10:58:27+00:00\",\"dateModified\":\"2024-03-04T07:13:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-2.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-2.png\",\"width\":825,\"height\":260,\"caption\":\"Custom Price\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to create custom command to delete order in magento2\"}]},{\"@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 create custom command to delete order in magento2 - Webkul Blog","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-create-custom-command-to-delete-order-in-magento2\/","og_locale":"en_US","og_type":"article","og_title":"How to create custom command to delete order in magento2 - Webkul Blog","og_description":"How to create custom command to delete order in magento2 &#8211; In Magento 2 &nbsp;you can create your own custom command for any action. As magento doesn&#8217;t allow to delete order from admin dashboard then in this case there comes a need for how to delete orders. So here using this post I am going [...]","og_url":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2016-03-10T10:58:27+00:00","article_modified_time":"2024-03-04T07:13:12+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-2.png","type":"image\/png"}],"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-create-custom-command-to-delete-order-in-magento2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/"},"author":{"name":"Pooja Sahu","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/420601cccfd5bc83506bcdd12362504b"},"headline":"How to create custom command to delete order in magento2","datePublished":"2016-03-10T10:58:27+00:00","dateModified":"2024-03-04T07:13:12+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/"},"wordCount":254,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-2.png","keywords":["commands","Custom","delete","Magento2","order"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/","url":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/","name":"How to create custom command to delete order in magento2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-2.png","datePublished":"2016-03-10T10:58:27+00:00","dateModified":"2024-03-04T07:13:12+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-2.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-2.png","width":825,"height":260,"caption":"Custom Price"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-create-custom-command-to-delete-order-in-magento2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to create custom command to delete order in magento2"}]},{"@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\/42925","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=42925"}],"version-history":[{"count":7,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/42925\/revisions"}],"predecessor-version":[{"id":425806,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/42925\/revisions\/425806"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/39266"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=42925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=42925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=42925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}