WordPress Integration
5 min read
Prerequisites
- WordPress 5.0+
- PHP 7.4+
- A Cacuda account with an API key (generate one at /account)
Install the Plugin
- Download
cacuda-automod.zipfrom the Cacuda dashboard - In your WordPress admin, go to Plugins > Add New > Upload Plugin
- Upload the zip file and click Install Now
- Click Activate
Configure Settings
Go to Settings > Cacuda Automod in your WordPress admin and enter:
- API Key — your Cacuda API key
- Webhook URL — found on your automod's detail page
- Webhook Secret — used to sign payloads for verification
How It Works
The plugin hooks into wp_insert_post and wp_insert_comment actions. When new content is created:
- WordPress fires the hook with the new content
- The plugin constructs a JSON payload with the content, author, and metadata
- It signs the payload body with HMAC-SHA256 using your webhook secret
- The signed payload is sent to your Cacuda webhook URL
Create a WordPress Automod
- Go to /automod and create a new automod
- Add a WordPress trigger node from the palette
- Select which events to listen for:
post_created,comment_created - Add a spam detection processor node and connect it to the trigger
- Add approve/reject action nodes connected to the pass/fail outputs
Test with a Draft
Create a new post in WordPress as a draft. The plugin will send it to your automod pipeline for analysis. Check the execution log at your automod's Executions tab to verify the pipeline ran correctly.
Tip: Start with draft posts to test your pipeline before enabling it for published content.
Callback Actions
When your pipeline completes and reaches an action node, Cacuda calls back to WordPress with the result:
- Approve — the post is published or the comment is approved
- Reject — the post is moved to trash or the comment is marked as spam
The plugin's callback endpoint verifies the HMAC signature before processing any actions, ensuring only authenticated responses are applied.