Run PHP on the site
wp_php_runExecute PHP code inside a live WordPress runtime to inspect state, run queries, and capture output or fatal errors. Requires confirm:"run".
Instructions
Execute PHP inside the live WordPress runtime with WordPress loaded ($wpdb, WP_Query, all plugins available). Output buffering and return values are captured; fatal errors are reported. Use it to inspect real state, not to guess. Requires confirm:"run".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | PHP without the opening <?php tag | |
| mode | No | php = pure code; template = mixed code and HTML output | php |
| confirm | Yes | Must be "run" |