Run WP CLI command

Runs a WordPress CLI command 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 the wp command, this is automatically appended.

Request

POST
/api/servers/{server}/wp-cli/run
curl -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"
}