WordPress has a built-in scheduling system called WP-Cron. It handles scheduled posts, plugin tasks, maintenance jobs, and other background operations.
One detail is worth knowing: WP-Cron isn't a traditional server cron.
By default, WordPress checks for scheduled tasks when someone visits the website. That means a task scheduled for 10:00 AM might not execute at exactly 10:00 AM if nobody visits the site.
While maintaining our WordPress websites, including ComparePilot, I moved scheduled task execution away from page requests.
Here's what I changed
Step 1: Disable the Default WP-Cron Trigger
I edited wp-config.php and added:
define('DISABLE_WP_CRON', true);
This disables the automatic WP-Cron trigger associated with page loads.
It doesn't delete scheduled tasks or prevent wp-cron.php from running when called directly.
Important: Don't stop here. If you disable WP-Cron without configuring a replacement, scheduled operations may stop executing.
Step 2: Schedule a Real Cron Job in cPanel
Our sites run on cPanel hosting, so we used its built-in Cron Jobs feature.
Then I configured the scheduled task to run every 15 minutes:
*/15 * * * *
A typical cPanel command for triggering WordPress cron is:
wget -q -O - "https://example.com/wp-cron.php?doing_wp_cron" >/dev/null 2>&1
Replace example.com with your own domain. This is an example command; the exact execution method depends on the hosting setup.
Instead of relying on visits to trigger scheduled work, the server now starts the task at regular intervals.
Step 3: Check That Scheduled Tasks Still Run
After changing the configuration, verify that WordPress continues processing scheduled events.
You can inspect scheduled events using WP Crontrol or another suitable monitoring tool.
Check that:
- Scheduled posts are published.
- Plugin maintenance tasks continue running.
- Cron events don't remain overdue indefinitely.
- Your hosting account isn't reporting execution errors.
The last point is important because a cron job can exist in cPanel without executing successfully.
Why I Used a 15-Minute Interval
I didn't need every background task to run immediately.
A 15-minute interval was a reasonable schedule for our publishing workflows and routine maintenance tasks.
However, it isn't suitable for every WordPress website.
A store processing frequent orders or a site running time-sensitive automation may need shorter intervals.
Also, a task may run later than its nominal schedule because the next cron execution hasn't started yet.
What Changed?
I made two configuration changes:
Disabled WordPress's page-load cron trigger.
Scheduled regular execution through cPanel.
I didn't modify WordPress core files or install another scheduling plugin.
This gave me a predictable trigger for scheduled tasks without depending on visitor activity.
It's a small infrastructure change, but one worth considering when running WordPress on shared hosting.
Feel free to leave questions in the comments.
