WP Agent — Setup
WP Agent is a WordPress-native AI agent runtime. It runs inside your site and can be used through multiple interfaces:
- WordPress admin + REST API
- WP-CLI
- Chat apps (Discord / Telegram)
- Optional on-site Chat block
Requirements
- WordPress 6.9+
- PHP 8.1+
Install
- Upload/install the plugin zip or clone into:
wp-content/plugins/wp-agent/ - Activate WP Agent in WP Admin → Plugins.
Configure AI Provider
Go to Settings → WP Agent.
- Provider: choose the provider
- Model: choose the model
- API Key:
- Either set
wp_agent_api_keyin settings, or - Provide a shared key via the
chubes_ai_provider_api_keysfilter (advanced)
- Either set
Execution policy (security tiers)
WP Agent can run with different execution tiers. Default is wp-native.
- Either set
wp_agent_api_keyin settings, or - Provide a shared key via the
chubes_ai_provider_api_keysfilter (advanced)
Configure this in Settings → WP Agent → Execution Policy.
Use WP Agent
Option A — WordPress REST API (admin)
Endpoint:
- Either set
wp_agent_api_keyin settings, or - Provide a shared key via the
chubes_ai_provider_api_keysfilter (advanced)
Requires:
- wp-native: WordPress-native abilities only (no shell dependence)
- restricted-shell: allowlisted shell access for admin users
- extended-shell / trusted: advanced modes (only enable when you understand the risk)
Option B — WP-CLI
Examples:
wp agent status
wp agent chat "List active plugins"Option C — Discord / Telegram
Configure channel settings in Settings → WP Agent → Channels.
Option D — On-site Chat block (optional)
Insert the block:
POST /wp-json/wp-agent/v1/chat
Notes:
- logged-in user with
manage_options - a valid WP REST nonce
Making channels reactive
WP Agent runs using Action Scheduler (preferred) with WP-Cron as a fallback.
On low-traffic sites, WP-Cron/Action Scheduler may not run promptly unless something triggers them.
When an inbound message is received (webhook/REST), WP Agent will enqueue it and trigger an async Action Scheduler run (when available) to process the queue ASAP.
Recommended: system cron runs Action Scheduler (most reliable)
If you have server cron access, add a job (example: every minute):
* * * * * cd /var/www/your-site && wp action-scheduler run --due-now --quiet --allow-root(Use the correct site path and drop --allow-root if you’re not root.)
Alternative: system cron hits wp-cron.php
* * * * * curl -fsS https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1This is less direct, but works on hosts where WP-CLI cron isn’t possible.
Notes
- Block name: WP Agent Chat (
wp-agent/chat)
Troubleshooting
- This is one interface option.
- The chat endpoint is authenticated (admin-only) by default.
- Image support is available (upload requires Media permissions).