Loading...

Knowledge Base
Save up to  70% off.  Start your website today!

WordPress Error During the API Request

The following error may occur when attempting to view plugins or themes in WordPress:

Error: An Unexpected HTTP Error occurred during the API request.

If this occurs, you can try editing the http.php file within the wp-includes folder of your WordPress installation. Editing the http.php file is a common fix for this issue; however, it is not guaranteed, as various issues can be the cause of this specific timeout error. Please note that while our agents may have outside knowledge of common web design issues and coding, we are unable to provide assistance with custom coding and scripting, third-party web design, troubleshooting, and website optimization outside of basic internet research.

How to Edit the http.php File

To edit the http.php file:

  1. Log in to cPanel.
  2. In the Files section, select the File Manager icon.

    Hostgator cPanel File Manager

  3. Click on public_html on the left menu.
  4. Open the wp-includes folder.

    File Manager wp-includes

  5. Locate the http.php file and right-click on it.
  6. In the pop-up menu that appears, select the Edit option.

    File Manager http.php

  7. In the pop-up that appears, choose Edit to open the Text Editor.

    File Manager Edit

  8. Scroll down to find  the following line:
    'timeout' => apply_filters( 'http_request_timeout', 5),
  9. Update the line to the following:
    'timeout' => apply_filters( 'http_request_timeout', 30),
  10. Click Save Changes in the top-right corner.
  11. Once these steps are complete, refresh the WordPress page to see if the error has been resolved.

Additional References

If the above fix does not work, here are some support articles you can use.

 

Did you find this article helpful?

 
* Your feedback is too short

Loading...