disable_cronjob_magento_2 disable_cronjob_magento_2

How to Disable Cron Job in Magento 2

As a Magento 2 developer many times you are in a situation where you have to disable cron job of some third-party modules. You have to disable that cron job because it is creating an issue or not running as per the cron schedule.

In Magento 2, cron jobs do not have a disable feature like observer and plugin. Then how to disable cron job in Magento 2? Well, in this post we will show you a very simple method to disable the cron job in Magento 2.

Disable Cron Job in Magento 2

To disable the cron job in Magento 2 you have to first create your module and rewrite the same cron job in your module’s crontab.xml file.

Let’s say I want to disable the cron job called notify_me which is defined in the Orange_Notify module. To disable this cron job create crontab.xml file under your custom module and change the schedule value to 0 0 30 2 *.

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="default">
    <job name="notify_me" instance="OrangeNotifyModelNotify" method="execute">
        <schedule>0 0 30 2 *</schedule>
    </job>
</group>
</config>

By doing this we are telling Magento to run notify_me cron job at 00:00 on the 30th of February – at the date which will never happen. That means this cron job will never run.

Written by

Chirag

Chirag is a Founder & eCommerce Technology Leader at MageArmy. He leads the eCommerce development team and drives the company’s technology vision, helping businesses build, scale, and optimize high-performing online stores. With years of experience in eCommerce development, he has worked with businesses across industries to solve complex technical challenges and create scalable digital commerce solutions. He loves sharing practical insights about eCommerce development, Magento, Adobe Commerce, and the latest trends in digital commerce to help online businesses grow and succeed.