Skip to main content
All cron endpoints are available since v2.1.0.

GET /cron/events

Returns all scheduled cron events sorted by next-run timestamp ascending.
curl -X GET https://example.com/wp-json/wp-manager-pro/v1/cron/events \
  -H "X-WP-Nonce: YOUR_NONCE"

Response

Returns an array of event objects.
hook
string
The WordPress action hook name.
timestamp
integer
Unix timestamp of the next scheduled run.
next_run_human
string
Human-readable time until the next run (e.g. in 5 minutes).
schedule
string
The recurrence schedule key (e.g. hourly). Empty for single-run events.
schedule_label
string
Human-readable label for the schedule (e.g. Once Hourly).
interval
integer
Schedule interval in seconds. 0 for single-run events.
args
array
Arguments passed to the hook when it fires.
args_hash
string
MD5 hash of the serialized args array, used to uniquely identify the event instance.
is_core
boolean
Whether the hook belongs to WordPress core.

POST /cron/run

Triggers a cron event immediately by calling do_action_ref_array with the given hook and arguments.
curl -X POST https://example.com/wp-json/wp-manager-pro/v1/cron/run \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"hook": "wp_scheduled_delete"}'

Parameters

hook
string
required
The name of the WordPress action hook to trigger.
args
array
Arguments to pass to the hook. Defaults to an empty array.

Response

success
boolean
true if the hook fired without throwing an exception.
hook
string
The hook name that was triggered.
duration
number
Execution time in milliseconds.
output
string
Any output buffered during execution.
error
string | null
Exception message if the hook threw an error, otherwise null.

DELETE /cron/event

Unschedules a cron event. If both timestamp and args are provided, only that specific event instance is removed. Otherwise all occurrences of the hook are cleared.
Deleting a core WordPress cron event (such as wp_version_check or wp_update_plugins) will prevent automatic updates and health checks from running until the event is re-registered.
curl -X DELETE https://example.com/wp-json/wp-manager-pro/v1/cron/event \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"hook": "my_custom_event"}'

Parameters

hook
string
required
The hook name to unschedule.
timestamp
integer
Unix timestamp of the specific event instance to remove. Must be paired with args.
args
array
Arguments of the specific event instance to remove. Must be paired with timestamp.

Response

success
boolean
Always true on success.
hook
string
The hook name that was unscheduled.

GET /cron/schedules

Returns all registered cron schedules, including built-in WordPress schedules and any custom schedules created through the plugin.
curl -X GET https://example.com/wp-json/wp-manager-pro/v1/cron/schedules \
  -H "X-WP-Nonce: YOUR_NONCE"

Response

Returns an array of schedule objects sorted by interval ascending.
key
string
The schedule identifier (e.g. hourly).
display
string
Human-readable label (e.g. Once Hourly).
interval
integer
Interval in seconds.
is_custom
boolean
Whether this schedule was created through WP Manager Pro.

POST /cron/schedules

Creates a custom cron schedule. The schedule is immediately available for use by new cron events.
curl -X POST https://example.com/wp-json/wp-manager-pro/v1/cron/schedules \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"key": "every_ten_minutes", "display": "Every 10 Minutes", "interval": 600}'

Parameters

key
string
required
Unique machine-readable identifier for the schedule. Only lowercase letters, numbers, and underscores are allowed.
display
string
required
Human-readable name shown in the WordPress admin.
interval
integer
required
Interval in seconds. Must be at least 60.

Response

success
boolean
Always true on success.
key
string
The saved schedule key.
display
string
The saved display name.
interval
integer
The saved interval in seconds.

DELETE /cron/schedules

Deletes a custom cron schedule. Only schedules created through WP Manager Pro can be deleted.
curl -X DELETE https://example.com/wp-json/wp-manager-pro/v1/cron/schedules \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"key": "every_ten_minutes"}'

Parameters

key
string
required
The key of the custom schedule to delete.

Response

success
boolean
Always true on success.
key
string
The key of the deleted schedule.

GET /cron/health

Returns cron health diagnostics including overdue events, configuration flags, and suggested server cron commands.
curl -X GET https://example.com/wp-json/wp-manager-pro/v1/cron/health \
  -H "X-WP-Nonce: YOUR_NONCE"

Response

disabled
boolean
true if DISABLE_WP_CRON is defined and set to true in wp-config.php.
alternate_cron
boolean
true if ALTERNATE_WP_CRON is enabled.
lock_timeout
integer
Value of WP_CRON_LOCK_TIMEOUT in seconds. Defaults to 60.
doing_cron
boolean
Whether a cron process is currently running (based on the doing_cron transient).
total_events
integer
Total number of scheduled events.
overdue_count
integer
Number of events that are past their scheduled run time.
overdue_events
array
real_cron_command
string
A suggested server crontab command to trigger WP-Cron every 5 minutes via curl.
wp_cli_command
string
The WP-CLI command to run all due events manually.

Build docs developers (and LLMs) love