Are you seeing the cURL error 28: Connection timed out error on your WordPress site?
The cURL error 28 is a common WordPress REST API issue that can affect your website’s performance and may cause it to behave unpredictably.
In this article, we will show you how to easily fix the ‘cURL error 28: Connection timed out’ issue on your WordPress website.
What is cURL in WordPress?
The cURL is a software utility used by WordPress and many other web applications to send and receive data requests using URLs.
The cURL library plays a crucial role in how WordPress works behind the scenes. If it is not configured properly, then your WordPress website will not function properly.
What Causes cURL error 28 in WordPress?
Failure to respond back to the server’s data requests in a timely manner causes cURL error 28 in WordPress.
WordPress uses REST API (a programming technique) to send and receive data requests. If these requests time out, then you’ll see it as a critical issue in the Site Health report with the title ‘The REST API encountered in error’.
Expanding the error will show you further details including the error message:
Error: cURL error 28: Operation timed out after x milliseconds with x bytes received (http_request_failed)
You may also see another related issue with the title ‘Your site could not complete a loopback request’. It will have a similar error message with 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?
A number of scenarios may cause the cURL to time out in WordPress.
For instance, a WordPress firewall plugin may block a REST API request considering it to be a suspicious activity.
If your DNS server is not working correctly, then this may also fail HTTP requests and cause the cURL timeout error in WordPress.
A poorly configured WordPress hosting server may simply have a very low timeout threshold which may stop certain WordPress processes to run properly.
That being said, let’s take a look at how to troubleshoot and fix the ‘curl error 28: Connection timed out’ issue in WordPress.
1. Temporarily Disable WordPress Firewall
If you are using a WordPress firewall or a security plugin, then go ahead and temporarily deactivate it.
After that, you need to visit the WordPress site health report page to see if your issue has resolved.
If it has, then you need to check your WordPress firewall logs to see which API requests have been blocked.
This would either identify the source of the issue or you can adjust firewall settings to not block legitimate API requests.
2. Deactivate All WordPress Plugins
WordPress plugins make their own API requests to send and receive data. If these calls are too frequent or take too long to complete, then this may cause the cURL error in your site health report.
The easiest way to figure this out is by deactivating all WordPress plugins. Simply go to the Plugins » Installed Plugins page and select all plugins.
After that, click on the Bulk Actions drop down to select ‘Deactivate’ and then click on the ‘Apply’ button.
You can now visit the Site Health report to see if the issue has disappeared. If this resolved the issue, then you can start activating your plugins one by one until the issue reappears.
This will help you find the plugin that may be causing the issue and you can then ask the plugin author for support.
3. Ensure Your Hosting Server is Using the Latest Software
The next, step is to make sure that your WordPress hosting server is using the latest versions of PHP, cURL library, and OpenSSL.
You can check that by looking at the system information tab under Tools » Site Health page.
Simply switch to the ‘Info’ tab and expand the ‘Server’ section. From here you can get the information about software in
For the Full Article –
Please Continue Reading Here: How to fix cURL error 28: Connection timed out after X milliseconds
Quite helpful information and links can be seen on the full article.
source – WPBeginner.com