Secure webhook + WP‑CLI endpoint to run post‑deploy maintenance tasks from CI/CD.
- Flush rewrite rules
- Flush object cache (if available)
- Delete expired transients (and allows full transient purge via filter)
- Upload
wp-deploy-hook-runnerto/wp-content/plugins/ - Activate via Plugins screen
- Go to Tools → Deploy Hook Runner to view your endpoint + token
Endpoint: POST /wp-json/deploy/v1/run
Authenticate with either:
- Header:
X-Deploy-Token: <your-token> - Query param:
?token=<your-token>
curl -X POST -H "X-Deploy-Token: YOUR_TOKEN" https://example.com/wp-json/deploy/v1/run- name: WordPress post-deploy
run: |
curl -X POST -H "X-Deploy-Token: ${{ secrets.DEPLOY_TOKEN }}" https://example.com/wp-json/deploy/v1/runwp deploy-hook run
wp deploy-hook token
wp deploy-hook token --regenerate- Filter
wdhr_clear_all_transientstotrueto purge all transients. - Action
wdhr_after_tasksreceives the$reportarray after execution.
- Uses a random 32‑character token stored in the database.
- Accepts token via header or query param (for CI flexibility).
Built and maintained by Best Website — https://bestwebsite.com
Contact: support@bestwebsite.com
GPL‑2.0 or later
