r/WordpressPlugins • • Sep 17 '26

[FREE] I built a WordPress webhook plugin, posts, comments, uploads and signups all POST clean JSON to any URL

Post image

I do automation for a living. n8n workflows, ComfyUI pipelines, Hermes agents. Most of my work is getting one system to tell another system that something happened.

WordPress is the one that won't. There's no webhook in core. If you want your site to tell n8n that a post just went live, you write it yourself with add_action and wp_remote_post, or you have n8n poll the REST API on a schedule and burn workflow runs on "nothing changed yet".

I needed this for my own workflows often enough that I built it as a plugin instead of pasting the same snippet into every site. It's free and it's on wp.org now.

You paste one URL into Settings, tick the events you want, and each event POSTs a JSON payload to that URL. No API key to generate, no account to sign up for, nothing going through a third-party server.

Events you can toggle: post published, updated, trashed, permanently deleted. Comment added, comment status changed, comment deleted. Media uploaded. New user registered. Works on any post type, and the post payload can include the excerpt or the full content if your workflow needs it.

A published post sends roughly this:

{
"event": "publish",
"post_id": 42,
"title": "How to automate WordPress",
"slug": "automate-wordpress",
"url": "https://example.com/automate-wordpress",
"post_type": "post",
"status": "publish",
"author": "admin",
"timestamp": "2026-09-05 12:00:00"
}

There's a test button that sends a sample payload so you can check the receiving end before you trust it live, and a log in wp-admin showing every send with its HTTP status. It keeps the last 50.

Things it doesn't do, because I'd rather you know now:

It fires on events, not on a schedule. If you want a nightly digest of everything that happened, you assemble that on the receiving side.

There's a cool-down timer, 15 seconds by default and settable to 0. It stops a fast sequence of saves from firing the same event over and over. The trade is that if you publish and then edit again inside that window, you get one event instead of two.

There's no retry queue. If your endpoint is down when the event fires, the request fails and you see the error code in the log. Nothing re-sends it later. Retries would mean storing state or running a cron, and I wanted this to stay one file with no database tables.

https://wordpress.org/plugins/yak-event-hooks/

What I'm unsure about: I only wired the events I actually needed. Taxonomy changes, plugin updates and WooCommerce order events are missing, mostly because I didn't want to invent payload shapes nobody asked for. If you're trying to start a workflow on an event that isn't in the list, tell me which one and what the payload should carry.

3 Upvotes

6 comments sorted by

1

u/Efficient_Try_9136 Sep 17 '26

Setup:

  1. Install from the wp.org page, or Plugins > Add New and search "Yak Event Hooks".
  2. Go to Settings > Yak Event Hooks.
  3. In n8n, add a Webhook node, set the method to POST, enable it, copy the URL. Zapier and Make work the same way if that's your stack.
  4. Paste the URL in, tick the events you want, save.
  5. Click Send Test Payload Now. An HTTP 200 should appear in the log on the same page.

Plugin page: https://wordpress.org/plugins/yak-event-hooks/

Needs WordPress 5.0+ and PHP 7.4+. If the test shows a 403 or 404, it's almost always the URL not being live on the receiving end yet rather than the plugin.

1

u/TopSydeWP Sep 19 '26

two things i'd want before putting this on client sites: fire the request on shutdown (or a single-event cron tick) instead of inline in the save, otherwise a slow endpoint stalls the editor save for the whole wp_remote_post timeout, and add an optional shared secret with an HMAC of the raw body in a header so the receiver can verify the payload actually came from that site.

for events, upgrader_process_complete plus activated_plugin / deactivated_plugin would be the ones i'd use most. we run maintenance across about a hundred sites and the thing that bites you is an update landing out of band, so a payload with component type, slug, old version and new version is enough to reconcile against your own inventory. also worth using transition_post_status with the old status in the payload, since "publish" alone can't tell a workflow whether it was a new post or a scheduled one flipping over.

1

u/Efficient_Try_9136 Sep 19 '26

thanks for feedback. Will work on your suggestions

1

u/Efficient_Try_9136 Sep 19 '26

Both delivery items are in 1.3.0, live on the directory now.

Events queue during the request and flush on shutdown, priority 20, after WP flushes its buffers. Where the host has fastcgi_finish_request() or litespeed_finish_request() the response goes to the client first and the send then waits for a real status code. Where it has neither, the send goes non-blocking with the timeout capped at 2s and the log records "sent (response not awaited)" rather than inventing a 200. On a test install against an endpoint that stalls, a save went from 6.5s to 2.6s. There's a Delivery setting (background/sync) if you want the old inline behaviour while debugging, and the test button still blocks on purpose.

Signing is opt-in behind a shared secret field. Requests carry X-Yak-Signature: sha256=<hex> over <unix timestamp>.<raw body>, plus X-Yak-Timestamp, X-Yak-Delivery (a uuid per delivery, useful as a dedupe key on your side) and X-Yak-Site. Signing the timestamp together with the body means a captured payload can't be replayed later. No secret means no signature headers at all, the settings endpoint never returns the secret, and an empty value on a write means "leave it", so a fleet script can't wipe the key by accident.

On transition_post_status: that's already the hook, and the publish payload has carried old_status and new_status since 1.2.0, so scheduled flipping to publish is distinguishable from a new post.

Component events aren't in yet. That's the next release and your shape is what I had in mind: snapshot the version on upgrader_pre_install, emit on upgrader_process_complete so single, bulk and automatic updates all land, plus activated_plugin / deactivated_plugin, with type, slug, old_version, new_version and a trigger field separating manual from automatic from wp-cli.

One question instead of a guess. Across a hundred sites, is the thing that bites you a dropped send, or not knowing what's installed where? A bounded retry (one-shot cron tick, stays stateless) is cheap and I'd put it in the same release. A daily signed inventory snapshot is a bigger feature that changes what the plugin promises, so I'd rather build it only if reconciliation is the real problem.

1

u/sg_xp Oct 05 '26

Does it support WooCommerce order statuses?

1

u/Efficient_Try_9136 Oct 05 '26

No, not yet. It hooks core WordPress events, so posts, comments, media and new users, plus products through their post type. Nothing on orders. Woo registers orders as a non-public post type, so they don't even show up in the post-type list, and on stores using HPOS they aren't in the posts table anyway.

Two ways to get order events today.

Woo has its own webhooks under WooCommerce > Settings > Advanced > Webhooks. Use the "Order updated" topic. Status changes arrive as order.updated, there's no separate "status changed" topic, so you filter on the status in the payload. Worth knowing it fires on any order save, so an address edit shows up looking just like a payment.

If you need the actual transition, with the status it came from, that's woocommerce_order_status_changed and a POST of your own. If it's something you'd rather not maintain, that's the piece I'd wire into the plugin next.

What would you want the payload to carry? Order id, old status, new status, total, currency, customer email is what I'd start with. Tell me what's missing and it goes in as you need it.