Skip to content
Home » Documentation » Crontrol Hours » How to manually restrict CRON events

How to manually restrict CRON events

    Time needed: 5 minutes

    Learn how to use the Crontrol Hours plugin to manually run the automation that loops through your CRON events and moves them to the hours you specify.

    1. Navigate to Crontrol Hours’ admin page in WordPress

      After logging into the backend of WordPress, navigate to Tools > Cron Hours. Here you should see the default Settings tab.

    2. Configure your start time.

      In the settings tab, define your start time’s hour and minute using the 24-hour clock. The default setting is 20:00, or 8:00pm. The start time is the earliest time when you want recurring CRON events to run. This means CRON events may run on or after the start time.

    3. Configure your end time

      In the settings tab, define your start time’s hour and minute using the 24-hour clock. The default setting is 04:00, or 4:00am. The end time is the latest time when you want recurring CRON events to run. This means CRON events may run on or before the end time.

    4. Configure your intervals

      In the settings tab, define which recurring intervals you want to restrict using a comma separated list. The default intervals include three (3) of WordPress’ core intervals daily, weekly, and monthly. This means CRON events that run on these intervals will be restricted to only run during your specified hours. No more daily events occurring at 10am!

    5. Configure hooks to be excluded

      If you have any CRON events that run on a configured interval but must also outside your configured hours, you can specify those hooks in the Hooks to Exclude setting as a comma separated list.

    6. Choose if you need to force frequent events to become daily events

      Enable this setting if you’ve added intervals like hourly or twicedaily to your Intervals setting and want to force it to be a daily event rather than running twice a day. This only affects CRON events that are on a schedule that runs multiple times a day. It does not affect events that run on schedules longer than a day such as weekly or monthly.

    7. Choose if you need to restrict frequent requests to the specified hours

      Enable this setting if you’ve added intervals like every_minute or hourly to your Intervals setting and want them to only run between your start and end times while maintaining their interval. In other words, an hourly event will continue to run hourly but only between the start and end times. It will not run outside of the times configured above.

    8. Navigate to the Update Hours tab

      Once all of your Settings are configured, navigate to the Update Hours tab. This page includes the tool that summarizes what your settings will do and you can run this change at the click of a button instead of waiting until midnight for the first scheduled CRON event to run.

    9. Preview changes using a dry run

      With the Dry run box checked, no changes will be made when you click the Update CRON Events Now button. This box is checked by default. Click the Update CRON Events Now button to run the automation. After the click, you’ll see a spinning wheel while it works next to the button. When completed, you’ll see an ordered-list of debugging messages that explains exactly what it did and why below the button. It’s recommended to check for any errors, they’ll appear in red text.

    10. Make the real changes

      Uncheck the Dry run checkbox and click the Update CRON Events Now button to run the automation. After the click, you’ll see a spinning wheel while it works next to the button. When completed, you’ll see an ordered-list of debugging messages that explains exactly what it did and why below the button. It’s recommended to check for any errors, they’ll appear in red text.