WordPress Cron & Scheduled Tasks
Appointment reminders, follow-ups, and auto-complete depend on scheduled tasks. WordPress pseudo-cron only runs when someone visits your site — use a real server cron job on production.
How it works
WooCommerce Appointments uses ActionScheduler (WooCommerce’s task queue) for time-sensitive jobs. ActionScheduler still needs something to trigger wp-cron.php on a schedule.
Why it matters
Low-traffic sites can miss reminder emails if cron never fires. See Email issues if reminders stop.
You are ready when
- ✅ A server cron hits
wp-cron.phpevery 1–5 minutes (orDISABLE_WP_CRON+ real cron) - ✅ Tools → Scheduled Actions shows
wc-appointment-remindertasks for test appointments - ✅ Test reminder email arrives at the configured time
Scheduled tasks in Appointments
| Task | When | Configure |
|---|---|---|
| Appointment reminder | Before start | WooCommerce → Settings → Emails → Appointment Reminder |
| Appointment follow-up | After end | WooCommerce → Settings → Emails → Appointment Follow-up |
| Auto-complete | At appointment end | Automatic |
| Daily cleanup | Once per day | Removes stale in-cart rows, expired rules |
| Inactive cart removal | After cart hold period | Automatic |
Action names include wc-appointment-reminder, wc-appointment-follow-up, woocommerce_appointments_daily_cleanup.
WordPress cron vs real cron
Default (pseudo-cron): each page load checks due tasks — unreliable on quiet sites.
Recommended: system cron calls wp-cron.php on a fixed interval.
Server cron (cPanel / shared hosting)
Cron Jobs → every minute (* * * * *):
/usr/bin/php -q /path/to/your/site/wp-cron.php
Or:
curl -s https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Replace the path with your site root (often /home/username/public_html/wp-cron.php).
VPS / Linux
crontab -e
Add:
* * * * * /usr/bin/php -q /path/to/your/site/wp-cron.php
Disable pseudo-cron (optional)
When a real cron job is in place, add to wp-config.php:
define( 'DISABLE_WP_CRON', true );
Only set DISABLE_WP_CRON if a server cron job is already running. Otherwise scheduled tasks never execute.
Verify cron is working
- Tools → Scheduled Actions — look for
wc-appointment-reminderand related hooks - WP Crontrol (optional) — confirm
action_scheduler_run_queueruns regularly - Create a test appointment tomorrow; set reminder to 1 hour before; confirm email delivery
Troubleshooting
| Symptom | Fix |
|---|---|
| Reminders not sending | Enable real cron; check email settings; inspect Scheduled Actions |
| Tasks late | Low traffic — add server cron |
| Duplicate runs | Both pseudo-cron and server cron active — use DISABLE_WP_CRON with real cron only |
Monitoring plugins (WP Crontrol, Action Scheduler UI) help inspect tasks but do not replace a real cron job.
Related
- Email notifications
- Known issues — Email
- Developers — hooks on scheduled events