Run WP CLI command
Runs a WordPress CLI command on your server.
This call can take longer than usual because the actual command is run on-demand on your server.
POST/api/servers/{server}/wp-cli/run
Run a WP CLI command
This endpoint allows you to execute a WordPress CLI command on your server.
Required scopes
Manage servers
Required attributes
- Name
command- Type
- string
- Description
A command to run against the WP CLI tool. For example:
cache flush --path=/home/ploi/wpcli.examplehosting.com/public. Do not include thewpcommand, this is automatically appended.
Request
POST
/api/servers/{server}/wp-cli/runcurl -X POST "https://ploi.io/api/servers/{server}/wp-cli/run" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"command": "cache flush --path=/home/ploi/wpcli.examplehosting.com/public"
}'
Response
{
"status": "ok",
"message": "Success: The cache was flushed.\n"
}