# WP Cron
Configure how WordPress cron runs and trigger cron events manually.
Requires the WordPress Toolkit add-on.
For cron status and scheduled events overview, see Summary — Get Cron Summary.
Base path: .../wordpress-toolkit
# Set Cron Mode
Switch between built-in WP Cron and a server-side cron job that runs wp-cron.php every five minutes.
# HTTP Request:
PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/wp-cron/mode
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| mode | Yes | String | wp_cron — use WordPress built-in cron and remove the server cronjob; server_cron — disable built-in WP cron and create a server cronjob running wp-cron.php every 5 minutes |
# Curl Request Example:
curl --request PATCH \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/wp-cron/mode" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{"mode": "server_cron"}'
# Response:
# Successful Response
- 200 (Ok)
{
"message": "WordPress cron method updated successfully.",
"mode": "server_cron"
}
# Validation Error
- 422 (Unprocessable Entity)
{
"message": "The mode field is required."
}
# Server Error
- 500 (Internal Server Error)
# Run WP Cron
Execute WordPress cron events manually.
# HTTP Request:
PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/wp-cron/run
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| run_all | No | String | "true" to run all due events; "false" for default behavior |
# Curl Request Example:
curl --request PATCH \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/wp-cron/run" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{"run_all": "true"}'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"message": "Due WP Cron events executed successfully",
"output": "Success: Executed a total of 0 cron events.",
"status": "success"
}
}
# Validation Error
- 422 (Unprocessable Entity)
# Server Error
- 500 (Internal Server Error)