Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Increase the curl timeout in WordPress
Copied from
//adjustments to wp-includes/http.php timeout values to workaround slow server responses
add_filter('http_request_args', 'bal_http_request_args', 100, 1);
function bal_http_request_args($r) //called on line 237
$r['timeout'] = 15;
return $r;
add_action('http_api_curl', 'bal_http_api_curl', 100, 1);
function bal_http_api_curl($handle) //called on line 1315
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 15 );
curl_setopt( $handle, CURLOPT_TIMEOUT, 15 );

abhimmo commented Apr 25, 2017

how to fix curl error 10000 ms

civid commented May 13, 2017

You Sir, save me a lot of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment