wp_activate_plugin
Activate an installed WordPress plugin, defaulting to a dry-run preview; require allow_prod for live production writes.
Instructions
Activate one already-installed plugin.
ACTIVATING AN UNTESTED PLUGIN CAN BREAK A LIVE SITE: the activation hook runs
immediately and can fatal, and the plugin starts filtering the site's output the
moment it loads. Activate on staging first. plugin may be a slug ('akismet'), a
plugin file ('akismet/akismet') or its .php path - all three resolve to the same
plugin, and a slug matching two installed plugins is refused with the candidates
rather than guessed. A plugin that is already active comes back as a no-op, not an
error. DEFAULTS TO dry_run=true (returns a preview naming the plugin and its current
status; changes nothing). Pass dry_run=false to apply - the change is verified by
re-reading the plugin's status. Requires the REST transport. Prod writes require
allow_prod=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plugin | Yes | ||
| dry_run | No | ||
| install | Yes | ||
| allow_prod | No |