Is your WordPress website experiencing the cURL error 28: Connection timed out? This common issue can prevent your site from functioning properly and can even cause unexpected behavior. But don’t worry, there are a few simple steps you can take to fix it.
In this article, we’ll walk you through the most effective solutions for resolving the cURL error 28 on your WordPress website. We’ll cover everything from disabling your firewall to checking your SSL certificate to increasing your PHP limits.
Whether you’re a tech-savvy WordPress user or a complete beginner, we’ll make sure you have all the information you need to fix this error once and for all.
So what are you waiting for? Keep reading to learn how to fix the cURL error 28 and get your WordPress website back on track.
What is cURL in WordPress?
The cURL, a software utility utilized by WordPress and various other web applications, serves the purpose of initiating and processing data requests through URLs.
WordPress leverages cURL for managing multiple API requests. It’s worth noting that this functionality is presented as an extension of the PHP programming language, a responsibility typically overseen by your WordPress hosting provider.
The cURL library assumes a pivotal role in the concealed operations of WordPress. When not properly configured, it can lead to a malfunction of your WordPress website.
What Triggers cURL Error 28 in WordPress?
The emergence of cURL error 28 in WordPress is typically attributed to the failure to promptly respond to data requests from the server.
WordPress employs the REST API, (a programming methodology) to facilitate the exchange of data requests. Should these requests experience timeouts, you will encounter this issue flagged as critical in the Site Health report, labeled as ‘The REST API encountered an 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 could lead to a timeout issue with cURL?
Numerous situations can result in cURL timing out within the context of WordPress.
For example, a WordPress firewall plugin might obstruct a REST API request, deeming it suspicious behavior.
Similarly, an incorrectly functioning DNS server can disrupt HTTP requests, resulting in the cURL timeout error in WordPress.
Moreover, a poorly configured WordPress hosting server might establish an exceedingly short timeout threshold, thereby impeding the proper execution of certain WordPress processes.
Having considered these factors, let’s move into troubleshooting and resolving the ‘curl error 28: Connection timed out’ problem 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 installed on your WordPress hosting server.
Ideally, your server should be using PHP 7.4.13 or higher, curl 7.74.0 or higher, and OpenSSL 1.1.1 or higher.
If it doesn’t, then you need to contact your WordPress hosting company and request them to update the software for your hosting account.
4. Fix SSL Insecure Content Issues
If your WordPress site is using HTTPS / SSL, but it is not configured properly, then this could also lead your web server to block insecure cURL requests.
Similarly, if your WordPress site doesn’t use HTTPS / SSL, but it made an API call using an HTTPs URL, then those requests will fail too, and you may see the following cURL error instead:
‘Error: cURL error 7: Failed to connect to localhost port 443: Connection refused (http_request_failed)
To address this, kindly request your hosting service provider to undertake the reinstallation of the SSL certificate for your website. In the event that the problem endures, we recommend consulting our comprehensive guide on resolving prevalent SSL-related issues. This will enable you to establish SSL correctly on your WordPress website.
5. Seek Help from Hosting Service Provider
Should the aforementioned measures prove ineffective in rectifying the cURL error 28 on your WordPress site, it is highly probable that the underlying issue pertains to your hosting environment.