Key Takeaways
- WordPress cron runs scheduled tasks but only triggers on site visits
- Disable WP-Cron for page loads and use server cron instead
- Remove orphaned cron jobs from deleted plugins
- Monitor cron execution to catch issues early
- Excessive scheduled tasks can impact site performance
How WordPress Cron Works
WordPress needs to run scheduled tasks—publishing future posts, checking for updates, sending scheduled emails, running plugin maintenance. Traditional server cron jobs run on fixed schedules. WordPress cron works differently: it checks for due tasks when someone visits your site.
This "pseudo-cron" approach was designed to work on shared hosting where users don't have access to server cron. It's clever but imperfect. Low-traffic sites might have tasks that should run hourly sitting idle for days. High-traffic sites might have cron checks running on every request, adding overhead.
The Core Problem
WP-Cron depends on traffic to trigger. No visitors = no task execution. For sites that need reliable scheduled tasks—especially e-commerce, membership, or publishing sites—this dependency on traffic is a critical weakness.
What WordPress Schedules
Core WordPress Tasks
- Publishing scheduled posts
- Checking for core, plugin, and theme updates
- Sending update notification emails
- Removing old posts from trash
- Database maintenance tasks
Common Plugin Tasks
- Backup creation and cleanup
- Email queue processing
- Cache cleanup and regeneration
- Analytics and reporting
- Security scanning
- Subscription and membership processing
Potential Problems
- Missed execution: Tasks not running on low-traffic sites
- Overlapping execution: Multiple cron runs stacking up
- Orphaned tasks: Jobs from deleted plugins still scheduled
- Performance impact: Heavy tasks running during page loads
Optimizing WP-Cron
The recommended approach: disable WP-Cron's page-load trigger and use server cron instead.
Step 1: Disable WP-Cron on Page Load
Add to wp-config.php:
define( 'DISABLE_WP_CRON', true );
Step 2: Set Up Server Cron
Create a server cron job to trigger WP-Cron regularly. Add to your server's crontab:
*/5 * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Or using WP-CLI:
*/5 * * * * cd /path/to/wordpress && wp cron event run --due-now
Choosing the Interval
- Every 5 minutes: Good default for most sites
- Every minute: For time-sensitive tasks
- Every 15 minutes: For low-activity sites with non-critical tasks
Managed Hosting
Managing Scheduled Tasks
Using WP Crontrol Plugin
WP Crontrol provides a dashboard for cron management:
- View all scheduled events
- See when tasks are next due
- Identify which plugin created each task
- Delete orphaned tasks
- Manually run tasks for testing
Cleaning Up Orphaned Tasks
When plugins are deleted, their cron jobs may remain:
- Review scheduled tasks after removing plugins
- Delete tasks that reference missing functions
- Look for tasks with unfamiliar names
WP-CLI Cron Commands
# List all scheduled events
wp cron event list
# Run all due events
wp cron event run --due-now
# Run a specific event
wp cron event run hook_name
# Delete an event
wp cron event delete hook_name
Troubleshooting Cron Issues
Scheduled Posts Not Publishing
- Check if DISABLE_WP_CRON is set without server cron replacement
- Verify server cron is actually running
- Check for cron lock files stuck
- Test with wp cron event run --due-now
Tasks Running Too Often
- Review task schedules in WP Crontrol
- Check for plugins scheduling excessive tasks
- Look for tasks running every page load (should be scheduled)
Performance Degradation
- Move heavy tasks off page-load execution
- Spread tasks across different times
- Consider whether all scheduled tasks are necessary
| Symptom | Likely Cause | Solution |
|---|---|---|
| Scheduled posts not publishing | WP-Cron disabled, no replacement | Set up server cron |
| Tasks running late | Low traffic triggering | Use server cron |
| Slow page loads | Cron running on requests | Disable page-load cron |
| Database full of cron data | Orphaned tasks | Clean with WP Crontrol |
Cron for High-Traffic Sites
High-traffic sites have specific cron considerations.
Concerns
- Multiple simultaneous cron runs
- Database locks from concurrent tasks
- Heavy tasks impacting site performance
- Cron running on every cached page miss
Solutions
- Always use server cron, never page-load triggered
- Implement proper locking for custom tasks
- Run heavy tasks during low-traffic periods
- Consider dedicated cron workers for very heavy tasks
Keeping Cron Healthy
WordPress cron is essential infrastructure that often goes unnoticed until something breaks. A few simple optimizations—switching to server cron, cleaning orphaned tasks, and monitoring execution—prevent problems before they affect your site or users.
Take a few minutes to check your cron setup. Install WP Crontrol and review what's scheduled. If you're still running on default WP-Cron, consider the server cron approach. Your scheduled tasks—and your site's performance—will thank you.
Frequently Asked Questions
How is WordPress cron different from server cron?
Can too many cron jobs slow down my site?
How do I know what cron jobs are scheduled?
Should I disable WP-Cron entirely?
Need help optimizing your WordPress infrastructure?
I help organizations tune WordPress for reliability and performance. Let's discuss your WordPress setup.