Note: For WordPress 3 and above here’s the solution: An Unexpected HTTP Error occurred during the API request. – WordPress 3
When you get this error message all you have to do is follow these simple steps to resolve it. The notorious error message “An Unexpected HTTP Error occured during the API request.” appears because of the fixed timeout set by WordPress.
This happens when the WordPress server just gives up on your request because it’s taking too long to retrieve information. The error message is pretty annoying if you were trying to install a plugin or a theme with full excitement and anticipation.
It just happened with me when I was trying to install the “Broken Link Checker” plugin on NPXP. I just couldn’t resist myself from editing the php file responsible for this error message.
Follow these simple steps to resolve the “An Unexpected HTTP Error occurred during the API request.” Error message and get the solution:
1) Login to your FTP server
2) Open wp_include/http.php
3) Look out for the 223rd line inside
4) This is what you should be looking at: ‘timeout’ => apply_filters( ‘http_request_timeout’, 5),
5) All you have to do is change the value “5” to “30”, the value is actually is the number of seconds before the server times out.
6) This should resolve your problem.
No related posts.

Hey, this is Kamal and I operate the NPXP network of websites. I am a blogger as well as a freelancer.
i didn’t find code :‘timeout’ => apply_filters( ‘http_request_timeout’, 5) in http.php
i’m using wordpress 3.0.5
Hi mate,
This solution is for the older version of WordPress… I’ll try to find if there are any new fix for this
Very informative article indeed. I was really getting frustrated by this wordpress error. But you have solved my problem now. Thanks
i’m using wordpress 3.0.1
it doesn’t work for me
Found timeout setting in class-http.php but the solution didn’t work for me. Any ideas ?
For me too it dint work I am using wordpress 3.1.1
any other solution for this please…
My version is 3.0.1, I changed timeout value in class-http.php ! it worked for me ! Thanks alot
It was so simple & have taken almost half of the day.. Thanks for sharing this information… I would recommend others to follow these simple steps & get solution as 1, 2, 3… Thanks Again…
Doesn’t resolve the problem for me.
Thanks for the info, this problem got in my client site. I just got your post and solved by following your steps.
PYou can find this setting in the class-http.php file.
Btw it doesn’t helped me
My friends who have faced this problem have got it resolved through this solution. Hmmm…
This solution is not work for WordPress v3.0. Please provide the version number which you solved for.
Thanks!
It wasn’t WordPress 3. The solution was for the previous version of WordPress mate.
Here’s the solution for WordPress v 3.0 and above:
http://npxp.com/an-unexpected-http-error-occurred-during-the-api-request-wordpress-3