How to Increase WooCommerce API Timeout (2026 UK Guide)
17 August 2026
Learn how to increase WooCommerce API timeout in 2026. UK-focused steps for WordPress PHP, cURL, and server settings to fix slow API requests.
Understanding the WooCommerce API Timeout Issue
When your WooCommerce store communicates with external services – such as payment gateways, shipping providers, or accounting software – it relies on the WordPress HTTP API and PHP execution time. A timeout occurs when a request takes longer than the server's configured limit to receive a response. On many UK servers, the default max_execution_time is set to 30 seconds, while the cURL timeout can be as low as 5 seconds. If a request involves processing large numbers of orders or dealing with a slow third-party endpoint, the connection is killed. This results in failed API calls, endless loading screens, and frustrated customers.
Why UK Merchants Commonly Hit Timeouts
UK merchants often experience API timeouts due to a combination of factors. Shared hosting, common among smaller British businesses, has stricter limits than dedicated servers. Peak times – like Black Friday or the Christmas rush – can slow down both your store and the APIs you integrate with. Also, many UK-based plugins (for VAT, shipping, or accounting) make multiple sequential API calls, each needing its own time budget. If your WooCommerce database has thousands of orders, generating a complete API response can easily exceed 30 seconds. Understanding these triggers is the first step to applying the right fix.
Increase Timeout via wp-config.php and PHP Settings
A quick and direct method is to edit your WordPress configuration file. Open wp-config.php and add the following constant: define('WP_HTTP_TIMEOUT', 60); This raises the timeout for all HTTP requests made by WordPress. You can also set PHP execution time at the top of the file using ini_set('max_execution_time', 120);. On UK shared hosting, this may not always stick, but it’s worth trying. After making changes, save the file and check that your site still loads. You can test the new timeout using a custom script or by calling a WooCommerce REST API endpoint that previously failed.
Using Filters and Plugins to Extend cURL Timeout
For a more targeted approach, add a filter to your theme's functions.php or a custom plugin: add_filter('http_request_timeout', function($timeout) { return 60; }); This specifically extends the timeout for WordPress HTTP requests, including WooCommerce API calls. If you prefer a UI, plugins like 'WP Increase Request Timeout' or 'FluentSnippets' let you insert this code without touching core files. Remember to clear any caching plugin after making changes. For UK store owners, this method is particularly useful when integrating with HMRC APIs or Royal Mail shipping endpoints that can be slow during peak periods.
Server-Level Adjustments for UK Hosting Providers
On UK hosting like Krystal, 20i, or Pressidium, you can often adjust PHP settings via the control panel. Look for 'PHP Config' or 'INI Editor' tabs and set max_execution_time, max_input_time, and default_socket_timeout to 60 or higher. If you're on a UK VPS or dedicated server, edit the php.ini file directly and restart PHP-FPM or Apache. For Nginx servers, you may also need to adjust proxy_read_timeout to prevent gateway timeouts. If you're unsure, contact your host's UK support team – they are usually happy to help tune your environment for WooCommerce API performance.
FAQ
The default PHP max_execution_time on many UK servers is 30 seconds, while the WordPress HTTP timeout is set to 5 seconds. WooCommerce itself doesn't always override this, so your API calls can fail after just 5 seconds, depending on how they are made.