SOLVED – An Unexpected HTTP Error occurred during the API request on Wordpress Backend

Print This Post

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.

http_request_timeout

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. 

Google Buzz
RSS for Internet Techies Hello there! If you are new here, you might want to subscribe to the RSS feed for updates.
Share it
15 Responses to “SOLVED – An Unexpected HTTP Error occurred during the API request on Wordpress Backend”
  1. I actually got this message yesterday and I had no clue what was going on. Thanks for sharing this, helps me out a lot.

  2. Ruchi says:

    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.

      • Josh says:

        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.

  3. izzat aziz says:

    i often get the error.. thank for the tips it really helpful.. because i hate to refresh over and over..

  4. Ramkumar says:

    I havnt faced this problem yet, but will be very helpful if it happens in future.

  5. BlogrPro says:

    So far I didn’t face this problem. But will try this to avoid in future.

  6. Cool buddy.. I got this error last week.. when trying to edit and open my posts… thanks a lot.. :)

  7. greg says:

    Thanks for a great tip – I too get this problem frequently!

  8. Jason says:

    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?

  9. Sunny Khiani says:

    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

  10. Andrea says:

    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

Leave a Reply

If you have any query or question related to Blogging, Wordpress, Monetization thru Adsense, Plugins then kindly post your queries on Internet Techies Forum. We will definitely try to resolve that or some other members from our forum will do. Thanks for the consideration.

(required)

(required)