1. Check Your Internet Connection:
The first step to take when you encounter a cURL error 28 is to check your internet connection. Make sure that your internet connection is stable and that you have a good connection speed.
2. Increase the Timeout Value:
If your internet connection is stable, then you can try increasing the timeout value. This can be done by adding the following line of code to your cURL request:
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
This will increase the timeout value to 30 seconds.
3. Check Your Firewall Settings:
If you are using a firewall, then it is possible that it is blocking the connection. Check your firewall settings and make sure that it is not blocking the connection.
4. Check Your Proxy Settings:
If you are using a proxy server, then it is possible that it is blocking the connection. Check your proxy settings and make sure that it is not blocking the connection.
5. Check Your Server Settings:
If you are using a shared hosting server, then it is possible that the server is blocking the connection. Check your server settings and make sure that it is not blocking the connection.
6. Contact Your Hosting Provider:
If none of the above methods work, then you should contact your hosting provider and ask them to investigate the issue. They should be able to help you resolve the issue.
Although WordPress is a reliable Content Management System (CMS), it’s not infallible, especially when you’re making high-level customizations to the software. Therefore, you might sometimes run into WordPress errors. One of these is “cURL error 28: connection timed out.”
The good news is there are a few ways to fix the cURL error 28 in WordPress. These methods range from simple fixes, such as deactivating your plugins, to more advanced procedures, like updating your SSL settings.
In this post, we’ll explore the cURL error 28 and its causes. Then, we’ll explain how to solve this issue in WordPress using six different methods. Let’s get started!
What Is the cURL Error 28 in WordPress?
Client URL, also known as cURL, is a command line tool. Simply speaking, it transfers data to and from a server through URLs.
In the context of WordPress, the CMS uses cURL within the REST API. cURL handles API requests, enabling your website to access and transmit data to its server and corresponding database.
Here’s what that process looks like:
This data transfer process takes a certain amount of time. However, if it takes too long, it can time out and display the “cURL error 28: connection timed out” message.
You will typically see this message in the Site Health section of your WordPress dashboard. The error will have the headline “The REST API encountered an error”. Clicking on this heading will expand the message, where you might see the following:
Error: cURL error 28: operation timed out after x milliseconds with x bytes received (http_request_failed)
Alternatively, you may see this related error message:
The loopback request to your site failed, this means features relying on them are not currently working as expected.
What Causes the “cURL Error 28: Connection Timed Out” Error?
There are a few reasons you might be seeing the cURL error 28. For example, your WordPress firewall might interpret a particular REST API request as suspicious. Then, it will prevent it from completing in an attempt to protect your website against malware or other security threats.
Alternatively, a faulty or poorly-configured DNS server may prevent WordPress from loading the HTTP requests correctly. The DNS server receives domain name requests and translates them into IP addresses, sending users to the correct websites. If this process doesn’t work properly, it can time out and throw the cURL error 28:
Furthermore, your hosting provider may have put a low timeout limit on your server. This configuration means WordPress doesn’t have the time it needs to transfer the data between your website and its database.
Finally, WordPress plugins can cause this error message. Third-party software may contain code or scripts that interfere with the cURL data transfer process.
How To Fix the cURL Error 28 in WordPress (6 Methods)
In this section, we’ll explain how to fix the cURL error 28 in WordPress. We recommend trying each method in turn until the error message disappears.
It’s also worth considering using a staging site for this process. Then, you can troubleshoot the problem without affecting your live site.
With a Kinsta hosting plan, you can upgrade to premium staging environments. Then you can use up to five different environments, easily accessible from your MyKinsta dashboard.
Once you’ve fixed the issue on your staging site, you can push the changes live to solve the problem on your live website. Let’s start by explaining how to temporarily disable your firewall.
1. Temporarily Disable Your WordPress Firewall
We briefly touched on the idea of a WordPress firewall before. Essentially, this WordPress security mechanism filters suspicious traffic and prevents it from reaching your website. Sometimes, it might also be incorrectly blocking a legitimate REST API request and causing “cURL error 28: connection timed out.”
To verify if the firewall is causing the error, you’ll want to disable it temporarily. This process will differ slightly depending on your chosen software. We’ll show you how to do this with the Wordfence plugin.
In your WordPress dashboard, head to Wordfence > Firewall. Then scroll down to Web Application Firewall Status:
Select Disabled from the dropdown menu and click on Save Changes. Next, we recommend checking to see if your website still shows the cURL error 28.
After that, re-enable your firewall after a few minutes and see if it causes the error again. If so, consider choosing a different firewall plugin or contacting the plugin developers for further assistance.
2. Deactivate Your WordPress Plugins
Any of the WordPress plugins on your website could be causing the connection timeout error. Since you won’t know until you try them, this approach is all about trial and error. You’ll need to deactivate all your plugins and reinstall them one by one.
If you have access to your WordPress dashboard, this process is straightforward. Simply navigate to Plugins > Installed Plugins and check the top left box to select all of them. Then, click on Deactivate in the Bulk actions dropdown menu and hit Apply:
Alternatively, if the cURL error 28 is blocking access to your WordPress dashboard, you’ll need to manually disable your WordPress plugins. To do this, connect to your site with an SFTP client such as FileZilla.
Then, locate your wp-content folder. It should have a sub-folder called plugins:
Rename this folder to “plugins-old”. This will deactivate all of the plugins on your website. Next, you can log in to your WordPress dashboard and reactivate each tool until you find the one causing the issue.
Once you’ve found the problem plugin, you might consider downgrading WordPress until you can find a permanent solution. Otherwise, you can uninstall the plugin and look for alternative software for your site.
3. Explore Your SSL Settings
A Secure Sockets Layer (SSL) certificate is an essential security feature. When working correctly, it provides an encrypted connection between visitor browsers and your WordPress website.
However, an improperly installed or configured SSL certificate can cause issues on your website and block what it considers “insecure” requests. Therefore, it might trigger the cURL error 28 or other SSL connection errors such as cURL error 7.
First, you can verify if your SSL certificate is installed correctly by running an SSL check with the Qualys SSL Labs test. Just enter your hostname into the box and click on Submit. You’ll then receive a report highlighting any issues:
As you can see, our Kinsta hosting plans come equipped with a Cloudflare SSL certificate, and the above report shows no issues.
However, if you identify a problem with your SSL certificate, you can reinstall and reconfigure it, making sure you do so properly. To be sure, you can follow these instructions on how to correctly install an SSL certificate. After that, you can check to see if this has resolved the error.
4. Verify Your DNS Settings
As we briefly explained before, a poorly-configured DNS server can prevent WordPress from processing HTTP requests. This can throw the cURL error 28.
You’ll need to contact your hosting provider if the issue is with the DNS server itself. Your web host may be experiencing issues that prevent the server from processing requests before they time out.
Since you can’t control this process on your end, we recommend raising a support ticket with your host. This way, the support team can help you troubleshoot the issue and propagate the new DNS settings to put them into effect.
You can also verify DNS settings on your end. This method will be appropriate if you suspect that the issue is with your device (i.e., your computer).
You can adjust your DNS settings in Windows by pressing Windows + I. Then head to Network & internet and click on either Ethernet or Wi-Fi, depending on how your computer connects to the internet. Next, select the properties option for your connection:
Now open the settings for the DNS server assignment:
Select Manual from the dropdown menu and click on the slider next to IPv4:
In the Preferred DNS box, you can enter any of the following DNS addresses:
- Cloudflare: 184.108.40.206
- Google Public DNS: 220.127.116.11
- OpenDNS: 18.104.22.168
Then add one of the others to the Alternate DNS box. Remember to hit Save when you’re done. You may need to restart your computer before the changes take effect.
5. Check Your Server Limits and cURL Version
Outdated software or limited server resources may cause cURL requests to time out. For example, outdated PHP, cURL library, or OpenSSL could trigger the cURL error 28.
To check on this, head to Tools > Site Health > Info > Server in your WordPress dashboard:
You can read our article on the ideal WordPress PHP and server requirements to see if the values match up.
If they don’t, you can follow our guide on how to update your PHP version. Additionally, you can contact your hosting provider for further assistance or request to update the server configuration.
It’s also important to have some awareness of your website’s PHP memory limit and PHP time limit. This is because WordPress can time out when processing REST API requests if these limits are too low. As a result, this could cause a “508 resource limit is reached” or cURL error.
Again, your hosting provider generally sets the maximum values for these limits. Therefore, you’ll need to contact them if you’d like to increase the limits.
6. Contact Your Hosting Provider for Assistance
Finally, you may have tried all the troubleshooting methods in this tutorial, but you still see “cURL error 28: connection timed out”. While this can be frustrating, you have one last option: going directly to your web host for help.
If you’ve chosen a reliable hosting provider, you should have access to different support channels, such as live chat or a ticketing system. For example, at Kinsta, we provide live messaging and speedy responses:
When you contact your hosting provider, make sure to give as much information as you can about the error you’re seeing. Then your host will be better equipped to troubleshoot the issue.
“cURL error 28: connection timed out” can be frustrating to see when you’re working on your WordPress website. Fortunately, there are a few ways to troubleshoot this issue.
To fix the cURL error 28, we recommend starting with easy solutions like temporarily disabling your WordPress firewall and deactivating your plugins. Then, you can move on to checking your SSL and DNS settings, along with your server resource limits. Finally, if all else fails, it might be time to contact your web host for assistance.
Are you looking for a hosting provider to help you with any technical issues? Our Kinsta managed WordPress hosting packages come with 24/7 premium support. Plus, you’ll have access to our Kinsta APM tool for monitoring your website and improving its performance. Check out our plans today!
Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:
- Easy setup and management in the MyKinsta dashboard
- 24/7 expert support
- The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
- An enterprise-level Cloudflare integration for speed and security
- Global audience reach with up to 35 data centers and 275 PoPs worldwide
Get started with a free trial of our Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.