Take control of your CRON jobs by restricting them to your website's low traffic hours. From the admin screen, you can:
- Specify a daily window of when recurring CRON events should be triggered.
- Optionally limit events that run multiple times a day to only once a day.
- Optionally restrict events that run multiple times a day to only during your off-hours.
- Target specific schedules, including custom ones created by other plugins.
- Exclude specific CRON hooks from being affected
Benefits
Restricting your recurring CRON events to only run after hours helps with two (2) things:
- Automatic updates for WordPress core, plugins, and themes are prevented from running during your highest-traffic times so users aren't shown a maintenance page when it's the most visible.
- Less stress is placed on your server when automatic maintenance occurs during low traffic times.
Ensuring CRON Events Always Run
WordPress CRON is based on traffic, which means if your site does not see a lot of traffic, CRON events may not be triggered at the time that they are scheduled. Limiting your website's CRON events to off-hours while also depending on site traffic to trigger them may not produce the intended results. There are two (2) solutions I recommend:
- Use Server CRON. It is recommended in the WordPress developer resources to set up your system's task scheduler to run on the desired intervals and to use that to make a web request to
wp-cron.php
. View WordPress Documentation.
- Use Cron-Job.org. If you can't set up your system's task scheduler, I recommend outsourcing that job to cron-job.org to automatically ping your website's
wp-cron.php
file. It is a free service from the German-based developers. Go to Cron-Job.org.
There are three (3) ways to install my plugin: automatically, upload, or manually.
Install Method 1: Automatic Installation
Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't need to leave your web browser.
- Log in to your WordPress dashboard.
- Navigate to Plugins > Add New.
- Where it says "Keyword" in a dropdown, change it to "Author"
- In the search form, type
TessaWatkinsLLC
(results may begin populating as you type but my plugins will only show when the full name is there)
- Once you've found my plugin in the search results that appear, click the Install Now button and wait for the installation process to complete.
- Once the installation process is completed, click the Activate button to activate my plugin.
Install Method 2: Upload via WordPress Admin
This method involves is a little more involved. You don't need to leave your web browser, but you'll need to download and then upload the files yourself.
- Download my plugin from WordPress.org; it will be in the form of a zip file.
- Log in to your WordPress dashboard.
- Navigate to Plugins > Add New.
- Click the Upload Plugin button at the top of the screen.
- Select the zip file from your local file system that was downloaded in step 1.
- Click the Install Now button and wait for the installation process to complete.
- Once the installation process is completed, click the Activate button to activate it.
Install Method 3: Manual Installation
This method is the most involved as it requires you to be familiar with the process of transferring files using an SFTP client.
- Download my plugin from WordPress.org; it will be in the form of a zip file.
- Unzip the contents; you should have a single folder named
crontrol-hours
.
- Connect to your WordPress server with your favorite SFTP client.
- Copy the folder from step 2 to the
/wp-content/plugins/
folder in your WordPress directory. Once the folder and all of its files are there, installation is complete.
- Now log in to your WordPress dashboard.
- Navigate to Plugins > Installed Plugins. You should now see my plugin in your list.
- Click the Activate button under my plugin to activate it.