WordPressPlatform Configuration
Slack
Configure Slack in the FoPost WordPress plugin.
Slack
Configure the OwlStack WordPress plugin to publish posts to your Slack workspace channels.
Prerequisites
You can connect Slack using either a webhook (simpler) or a bot (more flexible).
Option A: Webhook (Recommended)
Creating a Slack Webhook
- Go to Slack API: Incoming Webhooks
- Create a new Slack app (or use an existing one)
- Enable Incoming Webhooks
- Click Add New Webhook to Workspace
- Select the target channel and authorize
- Copy the Webhook URL
Option B: Bot
Creating a Slack Bot
- Go to Slack API and create a new app
- Go to OAuth & Permissions
- Add the
chat:writebot scope - Install the app to your workspace
- Copy the Bot Token (starts with
xoxb-) - Invite the bot to your target channel with
/invite @YourBot
Settings
Navigate to OwlStack > Slack in the WordPress admin.
| Field | Description |
|---|---|
| Bot Token | Slack bot token, starts with xoxb- (for bot mode) |
| Channel | Target channel name, e.g., #general (required for bot mode) |
| Webhook URL | Slack incoming webhook URL (for webhook mode) |
Webhook vs. Bot
Use Webhook mode for simple posting to a single channel. Use Bot mode to publish to multiple channels or customize the sender name and icon.
Step-by-step (Webhook)
- Go to OwlStack > Slack in your WordPress admin
- Paste your Webhook URL
- Click Save Settings
Step-by-step (Bot)
- Go to OwlStack > Slack in your WordPress admin
- Paste your Bot Token
- Enter the target Channel (e.g.,
#general) - Click Save Settings
Testing
After saving your settings:
- Click Test Connection to verify your webhook or bot token
- Click Send Test Message to post a test message
- Check your Slack channel to confirm the message appeared
Publishing
Once configured, Slack appears as a toggle in the OwlStack meta box on post edit screens.
Programmatic publishing
// Simple message
owlstack()->slack('Hello from WordPress!');
// Message to a specific channel (bot mode)
owlstack()->slack('New post published!', null, null, [
'channel' => '#announcements',
]);Constraints
| Constraint | Value |
|---|---|
| Max message length | 40,000 characters |
| Max attachments | 20 |
| Supported media types | JPEG, PNG, GIF, MP4, PDF |
| Max file size | 1 GB |
Troubleshooting
| Issue | Solution |
|---|---|
| "Invalid webhook" | The webhook URL may have been revoked; create a new one |
| "channel_not_found" | Verify the channel name; for bot mode, invite the bot to the channel first |
| "not_authed" | Bot token is invalid or expired |
| Messages not appearing | Ensure the bot has chat:write scope and is a member of the channel |