Title: Setting &#8216;connect_timeout&#8217; in http_request_args?
Last modified: November 29, 2021

---

# Setting ‘connect_timeout’ in http_request_args?

 *  Resolved [Dekadinious](https://wordpress.org/support/users/dekadinious/)
 * (@dekadinious)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/setting-connect_timeout-in-http_request_args/)
 * It seems that it is not possible to set ‘connect_timeout’ in http_request_args?
   Can anyone educate me if ‘timeout’ overrides the ‘connect_timeout’?
 * I am filtering a plugin that makes blocking requests with a timeout of 60 seconds.
   I am setting the timeout to 1 second to avoid the plugin blocking page rendering.
   But in situations where the plugins struggles to even connect, am I then locked
   to the 10 second default of Requests::request?
 * Because I can’t see any place to set ‘connect_timeout’?
    -  This topic was modified 4 years, 6 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Developing with WordPress
      topic

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/setting-connect_timeout-in-http_request_args/#post-15114326)
 * The `http_request_timeout` filter will let you alter the request timeout, which
   appears to be used for the connect timeout with the curl transport. There is 
   no way to alter the connect timeout for the sockets transport. (Not entirely 
   true; you can hack the `wp-includes/class-http.php` file to add that option.)
   Filter documentation:
 * [https://developer.wordpress.org/reference/hooks/http_request_timeout/](https://developer.wordpress.org/reference/hooks/http_request_timeout/)
 *  Thread Starter [Dekadinious](https://wordpress.org/support/users/dekadinious/)
 * (@dekadinious)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/setting-connect_timeout-in-http_request_args/#post-15117544)
 * Yeah, it only alters the “timeout” and not the “connect_timeout” that I was looking
   for!
 * But thanks! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Setting ‘connect_timeout’ in http_request_args?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Dekadinious](https://wordpress.org/support/users/dekadinious/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/setting-connect_timeout-in-http_request_args/#post-15117544)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
