WP Webhook Connector
Connect WordPress events to external services via outgoing webhooks. Supports Slack, Discord, n8n, Make.com, and any custom API. Features 12 trigger events, merge tags, connector templates, delivery logging, test & retry, and WooCommerce support.
by R Saravanan · github.com/sharanvijaydev/wp-webhook-connector · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/sharanvijaydev/wp-webhook-connector/archive/refs/heads/main.zipConnect WordPress events to external services via outgoing webhooks. Supports Slack, Discord, n8n, Make.com, and any custom API — with 12 trigger events, merge tags, connector templates, delivery logging, test & retry, and WooCommerce support.
What It Does
When something happens in WordPress (post published, user registered, order placed), this plugin automatically sends that data to any external service via HTTP webhook — no code required.
WordPress Event → Webhook Rule → HTTP POST → External Service
(Slack, n8n, Discord, Make.com, any API)
Features
| Feature | Description |
|---|---|
| 📋 Rules Manager | Create, edit, enable/disable, and delete webhook rules |
| ⚡ 12 Trigger Events | Posts, users, comments, WooCommerce orders, and custom hooks |
| 🏷️ Merge Tags | 30+ dynamic placeholders replaced with real data at runtime |
| 🔗 Connector Templates | One-click pre-fill for Slack, Discord, n8n, Make.com |
| 📝 Custom Headers | Add API keys, auth tokens, or any custom HTTP headers |
| 🚀 Test Webhook | One-click test with sample data — instant feedback |
| 📊 Delivery Log | Full history with status, response codes, duration, and details |
| 🔄 Retry Failed | One-click retry for failed deliveries |
| 🛒 WooCommerce | Order placed, status changed, low stock (auto-detected) |
| 🎯 Custom Hooks | Enter ANY WordPress action hook name as a trigger |
Trigger Events
| Category | Events |
|---|---|
| Posts | Published, Updated, Trashed |
| Users | Registered, Login, Failed Login |
| Comments | New Comment Posted |
| WooCommerce | Order Placed, Order Status Changed, Product Low Stock |
| Custom | Any WordPress action hook |
Connector Templates
| Platform | What Gets Pre-filled |
|---|---|
| 💬 Slack | Slack Block Kit payload with sections and context |
| 🎮 Discord | Discord embed with title, description, color, footer |
| ⚡ n8n | Clean structured JSON for n8n webhook triggers |
| 🔧 Make.com | Make.com compatible webhook payload |
| 📝 Custom | Blank template for any API |
File Structure
wp-webhook-connector/
├── wp-webhook-connector.php # Main plugin bootstrap
├── includes/
│ ├── class-database.php # Custom tables (rules + logs)
│ ├── class-merge-tags.php # 30+ dynamic placeholders
│ ├── class-admin-page.php # Rules list + stat cards
│ ├── class-rule-editor.php # Add/edit form + connector templates
│ ├── class-dispatcher.php # Event hooks + HTTP dispatch
│ ├── class-delivery-log.php # WP_List_Table log viewer
│ └── class-ajax-handler.php # Test, toggle, retry via AJAX
├── assets/
│ ├── css/admin.css # Admin styles
│ └── js/admin.js # UI interactions
├── .gitignore
└── README.md
Installation
cd wp-content/plugins/
git clone https://github.com/sharanvijaydev/wp-webhook-connector.git
- Activate in Plugins → Installed Plugins
- Navigate to Webhooks in the admin sidebar
- Click Add New Rule to create your first webhook
Usage Example: Notify Slack on New Post
- Add New Rule → Name: "Notify Slack on new post"
- Quick Setup → Select "Slack" (pre-fills payload)
- Trigger → Post Published
- URL → Paste your Slack incoming webhook URL
- Save → Click "Send Test Webhook" to verify
- Done! Every new post now notifies your Slack channel.
Roadmap
| Version | Feature |
|---|---|
| v1.1 | Conditional logic (only if category = "News") |
| v1.2 | Response parsing and follow-up actions |
| v1.3 | Incoming webhooks (receive data INTO WordPress) |
| v2.0 | Visual workflow builder |
Technical Highlights
- Two custom database tables — rules and delivery logs, created via
dbDelta() - Dynamic hook registration — reads active rules and registers WordPress hooks at runtime
- Context-aware dispatch — collects relevant data based on which event triggered
- WooCommerce conditional loading — WC hooks only register if WooCommerce is active
- Merge tag engine — string replacement with automatic cleanup of unreplaced tags
- AJAX-powered UI — test, toggle, retry without page reloads
- Detail modal — inspect request/response payloads with JSON pretty-printing
- Security — nonce verification, capability checks, prepared SQL statements
- Zero dependencies — pure PHP + vanilla JS, no build tools
Security
- All admin pages require
manage_optionscapability - AJAX requests verified with
check_ajax_referer() - All database queries use
$wpdb->prepare() - Form submissions protected with
wp_nonce_field()/wp_verify_nonce() - Input sanitized with
sanitize_text_field(),sanitize_key(),esc_url_raw() - Output escaped with
esc_html(),esc_attr(),esc_url()
Author
R Saravanan
- LinkedIn: linkedin.com/in/sharanvijay
- Email: sharanvijay.r@gmail.com
- Portfolio: thozhilnutpamtech.com
License
GPL-2.0+ — See LICENSE