SOLVED – An Unexpected HTTP Error occurred during the API request on Wordpress Backend
Sometimes you will see an error message as ‘An Unexpected HTTP Error occurred during the API request’ after requesting a page on Wordpress Admin Dashboard. It may happen for 2 -3 minutes and then after that the panel starts behaving in a normal way. If you are getting this error frequently on your dashboard, then here is a fix / solution for this error.
Wordpress sets a timeout limit for every request. If that limit crosses for certain request, in that case you will get this message. If you need to resolve this issue, you can do that by increasing the time limit to a higher value. To increase the timeout limit of requests, go to the ‘wp-includes’ folder of your wordpress installation and edit http.php file over there. Here is the screenshot of the piece of code where you need to make the changes.
We have attached below the before and after changes in http.php file to avoid this error message.
Before Change
'timeout' => apply_filters( 'http_request_timeout', 5),
After Changes
'timeout' => apply_filters( 'http_request_timeout', 30),
Since we have increased the time limit from 5 seconds to 30 seconds, now you will not get this error message in your admin panel. You may increase this timeout value with any amount as per your choice. As I told you that this error message is appearing because the page request is crossing the time limit. It may happens because of plugins used in your Wordpress. If you are using lot many plugins which are not properly optimized, you may get this error. Go thru the wordpress optimization technique post to optimize your wordpress set to make your wordpress setup a bit lighter.





I actually got this message yesterday and I had no clue what was going on. Thanks for sharing this, helps me out a lot.
Thanks a lot for solving this problem, i will give it a try, i am facing this from past 7 days, i thought this must be because of the plugins which i have installed recently, even update on newer version of plugins is failing at times, is this the reason for it ? Can you throw some light on it ?
If you are using any Plugins which is not properly optimized, in that case you may face this issue. You may also face this problem when your blog is getting nice amount of traffic but still you are on shared hosting with bandwidth restrictions. Wordpress is very much bulky and that’s where Super cache plays an important role. But in case of admin panel, it doesn’t cache anything. In that case, every time your Wordpress setup executes too many PHP/Database code. That’s why we face this issue in backened only.
Hi Sanjeev,
First let me say THANK YOU for giving an understandable reason as to why this happens… I mean, I already knew, but it seems as though everyone else who has offered up this solution just says “do this, and it works” rather than explaining as you did in this comment I’m replying to.
Maybe you wouldn’t care to drop your opinion over at the WordPress.org forums?
It seems that everyone is extremely quick to point the finger of blame at SexyBookmarks as the culprit, when that is NOT the case at all… There are tons of people who’ve had this same issue with a clean WP install…
Anyway, thanks again for giving people a clear and resolute explanation.
Sorry, forgot to leave the direct link for you: http://wordpress.org/support/topic/227430
Thanks a lot Josh for the compliments. I am a big fan of Sexybookmarks and I personally feel that Sexybookmarks is not a culprit for this issue.
I have shared the info and solution on Wordpress.org forum (link provided by you). I hope people will start making the suggested changes and enjoy WP without this issue.
i often get the error.. thank for the tips it really helpful.. because i hate to refresh over and over..
I am glad that the solution helped you. Thanks
I havnt faced this problem yet, but will be very helpful if it happens in future.
So far I didn’t face this problem. But will try this to avoid in future.
Cool buddy.. I got this error last week.. when trying to edit and open my posts… thanks a lot.. :)
Thanks for a great tip – I too get this problem frequently!
Issue is – I can’t find wp-includes/http.php in my file manager directory at godaddy.com. I have the latest wordpress installed. Help?
SOLVED
1) Look for “feedity_widget_feed = “http://feedity.com/rss.aspx/sexybookmarks-net/UldQVFNb” in your plugins folder/sexybookmarks/sexy-bookmarks.php
2) Uncomment it or add a FEED that is active such as below:
// Your Feedity RSS feed URL
//feedity_widget_feed = “http://feedity.com/rss.aspx/sexybookmarks-net/UldQVFNb”;
3) Apply ‘timeout’ => apply_filters( ‘http_request_timeout’, 30), to your http.php in wp-includes
Thanks a lot! I was having this issue over and over. I made a reference to this post in my blog in Spanish: http://bit.ly/cdoqZQ