Get notified when WooCommerce disables a webhook
Published Updated 3 min read
WooCommerce webhooks connect your store to Zapier, HubSpot, inventory feeds and anything else that needs to know when an order lands or a product changes. When deliveries keep failing, WooCommerce switches the webhook off: five or more consecutive non-2xx responses from the receiving endpoint is the threshold. From then on it queues nothing, and orders placed after that moment send nothing.
Nothing tells you. Action Scheduler marks each job complete whether or not the webhook fired, and the dashboard shows no warning. You find out when a Zapier automation stops, when a customer asks why their order never reached your CRM, or when you happen to scroll the webhooks list.
A notification plugin closes that gap. When a webhook is disabled you get an email with its name, delivery URL, failure count and a link to its edit screen, and a Reset link on the webhooks screen clears the counter and re-enables it once the cause is fixed.
Five failures and the webhook goes quiet
WooCommerce keeps a failure counter per webhook. Every non-2xx response increments it, and once it passes the threshold the status flips to disabled and deliveries stop being queued. A brief outage at the receiving end is enough.
Setting the status back to active is not enough on its own, because that does not reset the counter. WooCommerce checks the count on the next delivery, so one more failure disables it again straight away. You have to fix the endpoint and clear the counter before the webhook will stay on.
An hourly check and a Reset link
Every hour a background task fetches all disabled webhooks, compares the list with the previous run, and emails the admin address about any that have been disabled since. You hear about a broken integration within the hour, and you get one email per incident rather than one per check. Every webhook topic is covered.
The email names the webhook, its delivery URL and current failure count, with a direct link to its edit screen.
The WooCommerce webhooks screen gains a notice listing every disabled webhook with a Reset link that sets the failure count to zero, sets the status back to active and returns you to the same screen. Use it after fixing the endpoint; reset before that and the next delivery disables it again.
A follow-up message can send alerts to a developer address instead of the site admin, or check on every delivery attempt so the alert fires on the failure that crosses the threshold rather than at the next hourly run.
Retries, diagnosis and re-enabling stay with you
Failed deliveries are not retried. WooCommerce retries before it disables the webhook, and replaying them afterwards risks duplicate processing at the other end.
It does not tell you why delivery failed. WooCommerce logs every attempt under WooCommerce > Status > Logs, with the full request payload and the response code, which is usually enough to spot an expired token, a changed endpoint URL or a receiving service that was down.
Nothing is re-enabled behind your back. The webhook failed for a reason, and switching it on quietly before that is fixed would only disable it again.
What you get
Included
- Hourly cron check that detects webhooks newly disabled since the previous run
- Email alert with webhook name, delivery URL, failure count, and a direct link to the edit screen
- Admin notice on the WooCommerce webhooks screen listing all currently disabled webhooks
- A per-webhook Reset action that clears the failure counter and re-enables the webhook
Not included
- Retrying failed deliveries or replaying missed webhook payloads
- Diagnosing the cause of delivery failures, which is in WooCommerce status logs
- Automatic re-enabling without admin action
- Per-webhook notification addresses: all alerts go to the site admin email
- Real-time detection on every failed delivery: the check runs on an hourly schedule
Questions
Does resetting the failure count fix the problem?
No. It clears the counter and re-enables the webhook, and if the endpoint still returns errors WooCommerce disables it again on the next attempt. Fix the endpoint first: check the URL, check the API token is valid, and check the receiving service is responding.
Build it in Steem
The button opens the builder with this guide's prompt filled in, so you can change anything before it runs. Nothing is built, and nothing is charged, until you send it.
Read the prompt (490 words)
Build a WordPress plugin called WooCommerce Webhook Monitor. Plugin Name: WooCommerce Webhook Monitor. Description: Sends an admin email when WooCommerce automatically disables a webhook due to consecutive delivery failures, and adds a reset option to the webhooks screen. Requires WooCommerce. Single PHP file. No dependencies beyond WordPress core and WooCommerce. Check that WooCommerce is active at plugins_loaded using is_plugin_active('woocommerce/woocommerce.php'). If WooCommerce is not active, add an admin_notices callback that displays a dismissible warning notice and return early from the rest of the setup. On plugin activation (register_activation_hook), do two things. First, call wc_get_webhooks(['status' => 'disabled']) to get currently disabled webhook objects, extract their IDs using array_map and get_id(), and save the result as a JSON-encoded array in the WordPress option wc_webhook_monitor_known_disabled. Second, schedule a recurring cron event named wc_webhook_monitor_check using wp_schedule_event(time(), 'hourly', 'wc_webhook_monitor_check') only if one is not already scheduled. On plugin deactivation (register_deactivation_hook), call wp_clear_scheduled_hook('wc_webhook_monitor_check') and delete_option('wc_webhook_monitor_known_disabled'). Hook the cron callback to the action wc_webhook_monitor_check. In the callback: call wc_get_webhooks(['status' => 'disabled']) to get the current list of disabled webhook objects. Extract IDs into an array. Read the option wc_webhook_monitor_known_disabled and json_decode it, defaulting to an empty array if missing or null. Find the IDs present in the current list but absent from the stored list — these are newly disabled since the last run. For each newly disabled ID, find the corresponding webhook object in the current results. Build a notification email: to get_option('admin_email'), subject '[' . get_bloginfo('name') . '] WooCommerce webhook disabled: ' . $webhook->get_name(), body including the webhook name, delivery URL ($webhook->get_delivery_url()), current failure count ($webhook->get_failure_count()), and a direct link to the webhook edit page built with admin_url('admin.php?page=wc-settings&tab=advanced§ion=webhooks&edit-webhook=' . $webhook->get_id()). Send with wp_mail. After processing, update the option wc_webhook_monitor_known_disabled with json_encode of the full current list of disabled IDs. Add an admin_notices hook. Check whether the current admin page is the WooCommerce webhooks screen by verifying is_admin() is true and that $_GET contains page=wc-settings, tab=advanced, and section=webhooks. If those conditions are met, call wc_get_webhooks(['status' => 'disabled']) to get disabled webhook objects. If there are any, output a div with class notice notice-warning. Print a paragraph stating that the following webhooks have been disabled by WooCommerce due to delivery failures. For each disabled webhook, output its name and delivery URL followed by a Reset link. Build the Reset link URL using wp_nonce_url(admin_url('admin-post.php?action=wc_webhook_monitor_reset&webhook_id=' . $webhook->get_id()), 'reset_webhook_' . $webhook->get_id()). If $_GET contains wc_webhook_reset set to 1, also output a separate dismissible notice div with class notice notice-success confirming the webhook was reset and re-enabled. Register the admin-post handler using add_action('admin_post_wc_webhook_monitor_reset', ...). In the callback: read webhook_id from $_GET using absint. Verify the nonce using check_admin_referer('reset_webhook_' . $webhook_id). Verify the current user has manage_woocommerce capability using current_user_can, and wp_die if not. Load the webhook using new WC_Webhook($webhook_id). Call $webhook->set_failure_count(0). Call $webhook->set_status('active'). Call $webhook->save(). Read the stored option, decode it, remove this ID from the array using array_filter, re-encode and update the option. Redirect to admin_url('admin.php?page=wc-settings&tab=advanced§ion=webhooks&wc_webhook_reset=1') using wp_safe_redirect followed by exit.
Steem