Categories: Wordpress Core

An Unexpected HTTP Error occured during the API request

Sometimes in WordPress you may face an error message  “An Unexpected HTTP Error occurred during the API request” when requesting a page from Admin Dashboard. It may happen for few minutes and after the panel starts behaving in a normal way. If you are getting this error frequently from your dashboard, then follow this simple steps to rid of this kind of situation.

WordPress gives 5 seconds time limit to request a plugin by default. If within 5 seconds it does not get a replay, the process will come to an halt and display an error “An Unexpected HTTP error occurred during the API request.”  To resolve this issue, you have to increase the time limit to a higher value. Just follow the steps:

STEP-1: Browse  WP-INCLUDE folder from root

STEP-2: Open class-http.php (latest wp versions) OR http.php (older wp-versions) file through notepad or available editor.

STEP-3: Find the below line :

[ HINTS: line number 96 from class-http.php file & line number 223 from http.php file]

'timeout' => apply_filters( 'http_request_timeout', 5)

STEP-4: Changed the line & make the timeout ’30’ seconds

'timeout' => apply_filters( 'http_request_timeout', 30)

STEP-5: Save & update the file.

That’s all.

This post has already been read 2672 times!

Mehedi Hasan

Cool WordPress Developer having much agile experience to develop any kind of WordPress sites & plugins. Also good in troubleshooting, fixing & making any kind of tweaks for WP site.

More Posts

Mehedi Hasan

Cool WordPress Developer having much agile experience to develop any kind of WordPress sites & plugins. Also good in troubleshooting, fixing & making any kind of tweaks for WP site.

Share
Published by
Mehedi Hasan
Tags: HTTP

Recent Posts

WP Share A Friend – A Way to Capture Lead

What is Lead Capture: In general sense lead capture designates a process or way of…

5 years ago

Unlimited Modal POPUPS on MouseClick

Introduction Unlimited Modal POPUPS on MouseClick: Everyone knows about popup during site visits and most…

5 years ago

WordPress Pregnancy Calculator Plugin

Brief about Pregnancy Calculator : This WordPress Pregnancy Calculator plugin allows users to display an…

5 years ago

Interactive Service Plugin with Hover Effects VC

Introduction About this Service Plugin: This Visual Composer Service Plugin works as an addon to…

6 years ago

WP Dynamic Query String

Introduction of Dynamic Query String : This plugin allows user to set dynamic query string…

6 years ago

How to make scroll PDF in iFrame for iPAD Safari

There is an occasional bug for iPhone and iPad even they are designed as well and…

7 years ago