WP Cron and Events Manager
Events Manager does some of its work in the background: sending reminder emails, releasing unpaid bookings, clearing temporary files. It schedules that work with WP-Cron, the task scheduler built into WordPress.
WP-Cron has one weakness that matters for events. It only runs when somebody visits the site, so on a quiet site a task due at 9:00 may not run until the first visitor arrives at 11:30. This page lists what Events Manager schedules and shows how to make the tasks run on time.
Tasks Events Manager schedules
Each task is only scheduled while the feature that needs it is switched on.
Events Manager
| Task (hook name) | Runs | What it does |
|---|---|---|
em_booking_intents_expire | Every minute, while booking holds are on | Deletes the leftover records of holds that ran out. Expired holds release their spaces whether or not this task runs. |
em_uploads_api_cleanup | Hourly | Deletes temporary files left by uploads that were started and never submitted. |
em_online_venues_queue | Every 5 minutes, when an online meeting provider such as Zoom is in use | Creates and updates the online meetings for your events with the provider. |
em_online_venues_sync | Hourly, with the task above | Checks that those meetings still match their events. |
em_upgrade_plugin_check | Once, straight after a plugin update | Runs any database changes the new version needs. |
Recurring events that are scheduled to publish at a future date also rely on WP-Cron, through the same task WordPress uses for scheduled posts.
Events Manager Pro Pro
| Task (hook name) | Runs | What it does |
|---|---|---|
emp_cron_emails_queue | Daily, at the WP Cron Time you set | Finds the events coming up and queues their reminder emails. Scheduled while Enable Event Email Reminders? is Yes. |
emp_cron_emails_process_queue | Every minute | Sends queued emails in batches of up to 100, including the email that releases a hidden online event link. |
emp_cron_emails_attachment_cleanup | Daily | Deletes the temporary calendar files attached to emails. |
em_gateways_cron | Every minute, when a gateway has a payment time limit or the payment page is on | Deals with bookings left unpaid past their time limit, so their spaces go back on sale. |
emp_cron_waitlist_check_expired | Every minute | Expires waitlist offers that were not taken up in time and offers the spaces to the next person. |
emp_cron_minimum_capacity | Every minute, while minimum capacity is on | Checks events against their minimum number of bookings. |
emp_cron_process_past_events | Every minute, unless Past Events Action is Keep Published | Changes the status of, trashes or deletes events that have ended. |
em_automation_cron_minute, _hourly, _daily, _twicedaily | As named, when an automation uses a time-based trigger | Fires time-based automation triggers. |
emp_cron_deposit_reminders | Daily, when deposits, the payment page and balance reminders are all on | Emails customers who still owe a balance. |
emp_bookings_reclaim_executions | Hourly | Recovers scheduled payment steps that started and never finished. |
emp_cron_gmap_static_cleanup | Daily, when static maps are cached with an expiry | Deletes expired cached map images. |
Add-ons Pro Plus
| Add-on | Task (hook name) | Runs | What it does |
|---|---|---|---|
| Connect | em_connect_reminders_cron | Daily, at the reminder time set in Connect | Sends SMS, WhatsApp and other message reminders. |
| Import/Export | emio_cron_hourly, _twicedaily, _daily, _twiceweekly, _weekly, _twoweeks, _monthly | As named | Runs the imports and exports you set to repeat at that frequency. |
| Zoom | em_zoom_refresh_series_meetings | Daily, when recurring events share a meeting series | Keeps the series meetings in step with their events. |
| Zoom Pro | em_zoom_sync | Hourly, when syncing is on | Brings in attendance and recordings from Zoom. |
| Xero | emp_xero_token_keepalive | Daily | Keeps the Xero connection from expiring. |
Several of these run every minute. WordPress can only keep to that if something triggers WP-Cron at least once a minute, which is the reason for the next section.
Make WP-Cron run on time
The dependable setup is to stop WordPress from triggering WP-Cron on page views, and have the server trigger it on a fixed schedule instead.
-
Open
wp-config.phpin the top folder of your WordPress install and add this line above the comment that says to stop editing:wp-config.phpdefine( 'DISABLE_WP_CRON', true ); -
In your hosting control panel, find the scheduled tasks screen (often called Cron Jobs) and add a job that runs every minute. In cron syntax that is
* * * * *. -
Use one of these as the command, replacing the address with your own site's:
wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1curl -s https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1If your host has WP-CLI, this does the same without an HTTP request:
cd /path/to/wordpress && wp cron event run --due-now >/dev/null 2>&1 -
Save the job, wait a few minutes and check that it is running.
If your host only allows a job every 5 or 15 minutes, use that. Tasks then run at most that many minutes late, which is fine for reminders and clean-up. The one place it shows is unpaid bookings and waitlist offers, which expire up to that many minutes after their time limit.
If your host has no cron jobs at all, leave DISABLE_WP_CRON out and use an outside service that requests https://example.com/wp-cron.php?doing_wp_cron on a schedule. Uptime monitors and dedicated cron services both do this.
Don't add DISABLE_WP_CRON without also setting up the job. With WP-Cron disabled and nothing calling wp-cron.php, no scheduled task runs at all: no reminders go out, and WordPress stops publishing scheduled posts.
Check that tasks are running
- With WP-CLI,
wp cron event listshows every scheduled task and when it will next run. A task whose next run is well in the past is not being triggered. - Without WP-CLI, a plugin such as WP Crontrol shows the same list in wp-admin and lets you run a task by hand.
- Tools then Site Health reports when scheduled events are running late.
Multisite networks
Each site on a network has its own schedule. One call to wp-cron.php on the main site runs the main site's tasks only. Add a job for each site's address, or loop over the sites with WP-CLI:
wp site list --field=url | xargs -I % wp cron event run --due-now --url=%
Troubleshooting
Reminder emails go out late or not at all
Check that the tasks are running, as above. Reminders are queued once a day at the WP Cron Time set in Events then Settings then Emails then Event Email Reminders and then sent by the every-minute task, so on a site with few visitors both steps wait for traffic. A server cron job fixes it.
Customers get the same reminder twice
On a busy site, page views can trigger WP-Cron several times at once. Moving to a server cron job, with DISABLE_WP_CRON set, means it is triggered once a minute and no more.
Unpaid bookings are not released on time
The time limit is checked by em_gateways_cron every minute. If WP-Cron runs less often, the booking is released at the next run after its limit.
Cron requests are blocked
Password protection, a maintenance mode plugin or a firewall rule on wp-cron.php stops both WordPress and your cron job from reaching it. Allow requests to that file, or use the WP-CLI command, which doesn't go through the web server.