Longer Timeout for WooCommerce Webhooks
Gives the services that receive your WooCommerce webhooks more time to answer, which stops slow endpoints such as Zapier or ERPs from being logged as failed.
Opens WPIDE on
Code
$wpide_webhook_timeout = 20; // Seconds.
add_filter( 'woocommerce_webhook_http_args', function ( $args ) use ( $wpide_webhook_timeout ) {
$args['timeout'] = $wpide_webhook_timeout;
return $args;
} );
Notes
WooCommerce's default is 5 seconds, and webhooks are sent in the background so customers never wait.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.