Install a plugin
wp_install_pluginInstall a WordPress.org plugin by slug and optionally activate it, with automatic rollback if activation worsens site health.
Instructions
Install a plugin from the WordPress.org directory by slug, optionally activating it. Needs install_plugins, and activate_plugins for activate (without it the plugin is installed and activated stays false); refused when DISALLOW_FILE_MODS is set. Returns installed, plugin (its file, e.g. akismet/akismet.php), activated and version, plus what the activation check reports; no undo point is recorded. Where its folder exists already, nothing is changed and the answer names the version installed; an installed plugin is brought to a newer version with wp_update_plugin. With activate, the activation is checked as with wp_activate_plugin and wp_activate_theme: where the site does worse with it active, it is taken back in the same call, and the answer, an error, names the error with file and line; what was installed stays installed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"slug": "<slug>"
},
"name": "wp_install_plugin"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | wordpress.org plugin slug, e.g. "akismet". | |
| activate | No | true activates the plugin after install (needs activate_plugins). Default false. |