Are you getting the cURL error 28 Connection timed out error on your WordPress website?
The cURL error 28 is a very common WordPress REST API error that can impact the performance of a website and may cause it to act abnormally.
In this blog post, we will guide you on how to fix the cURL error 28 Connection timed out error on your WordPress site.
What is cURL in WordPress?
The cURL is a PHP library utilized by WordPress and several other web applications to send and receive data requests via URLs.
Being a PHP library, if you have an outdated version of PHP, let’s say below PHP 7.0, then for sure, you are using an outdated version of the cURL version. Hence, if you face any issues with cURL, then the first and foremost thing you should do is update it to the latest stable version.
WordPress utilizes the cURL to manage various API requests. It plays a vital role in the working of WordPress in the backend. So, if your website isn’t correctly configured, your WordPress won’t operate precisely.
What Causes cURL Error 28 in WordPress?
cURL Error 28 is caused when the system fails to respond to the server’s data request within the stipulated time.
WordPress utilizes REST API to send and receive data requests. If the requests get timed out, you will observe the vital issue in the Site Health report that displays ‘ Rest API encountered an error.’
If you expand the error, you will be displayed with additional details about the error:
Error: cURL error 28: Operation timed out after x milliseconds with x bytes received (http_request_failed)
You may additionally observe a similar issue titled ‘Your site could not complete a loopback request.’ On expanding this issue, you will see the following description.
The loopback request to your site failed, this means features relying on them are not currently working as expected.
What may cause cURL to timeout?
Several use cases may cause the cURL to timeout in WordPress.
For example, there can be a possibility where the WordPress firewall plugin is blocking the REST API request recognizing it to be dubious activity.
If the DNS server is not working correctly, then it may fail HTTP requests and cause a cURL timeout error in WordPress.
Suggested For Further Reading:
With that being said, let’s have a look at how you can fix the cURL error 28 in WordPress.
Ways To Fix cURL Error 28 Connection Timed Out in WordPress
Disable Your WordPress Firewall Temporarily
In case you are currently utilizing the WordPress firewall or security plugin, deactivate it for time being.
Then, you need to visit the WordPress website health report page to view if the issue has been fixed or not.
If the issues have been fixed, then you will have to examine the WordPress firewall logs to observe which API requests have been barred.
By doing so, you will get the origin of the issue or you can configure the firewall settings to not restrict authorized API requests.
Deactivate All Of The WordPress Plugins.
WordPress plugins generate their own API requests for sending and receiving the data. If the API calls are too frequent or take much time to complete, then this may cause the cURL error in the site health report.
The simplest method to identify if any of the plugin is creating the issue is by deactivating all WordPress plugins. Just navigate to the Plugins » Installed Plugins page and choose all plugins.
After that, click on the Bulk Actions drop down to choose ‘Deactivate’ and then click on the ‘Apply’ button.
You can now revisit the Site Health report to see if the issue still persist or not. If the issue is solved then, you can reactivate the plugin one by one till the issue is gone.
We believe that this blog post helped you learn how to fix the cURL error 28 in WordPress. Meanwhile, you can have a look at our guide on “How to Fix WordPress Updating Failed or Publishing Failed Error?“
Additionally, We at 10GB Hosting offer Managed WordPress Hosting plans and also you can reach us by visiting our contact us page to resolve any WordPress related issues.