Picture of Amir Vincent
Amir Vincent

Amir Vincent is a digital-marketing entrepreneur and the co-founder and CEO of Canada Create™, a Toronto-based agency specializing in SEO, web design, paid search, and social-media strategies for international clients

Need quick help? Let’s Talk About Your Growth

For a faster response, call (416) 273-9030. Otherwise, fill out the form below and our team will contact you.

This field is for validation purposes and should be left unchanged.
Select the Services(Required)

Ultimate Guide to Resolving cURL Error 28: Fix Connection Timed Out Issues Fast!

curl-error-28-wordpress-og

Are you seeing 'cURL error 28: Connection timed out' error in your WordPress site health report? Learn how to fix the 'cURL error 28' issue in WordPress.

Are you encountering the cURL error 28: Connection timed out on your WordPress site?

The cURL error 28 is a frequent issue with the WordPress REST API that can negatively impact your website’s performance and lead to unpredictable behavior.

In this article, we will guide you through the steps to quickly resolve the ‘cURL error 28: Connection timed out’ problem on your WordPress site.

Here is a brief overview of the topics we will discuss in this tutorial:

  • What Is cURL in WordPress?
  • What Causes the cURL Error 28 in WordPress?
  • Temporarily Disable the WordPress Firewall
  • Deactivate All WordPress Plugins
  • Ensure Your Hosting Server Is Running the Latest Software
  • Resolve SSL Insecure Content Issues
  • Contact Your Hosting Provider for Assistance

What Is cURL in WordPress?

cURL is a software tool utilized by WordPress and many other web applications to send and receive data requests via URLs.

WordPress relies on cURL to manage various API requests. It is available as an extension of the PHP programming language, and your WordPress hosting provider manages it.

The cURL library is crucial for the proper functioning of WordPress. If it is not configured correctly, your WordPress site may not operate as intended.

What Triggers cURL Error 28 in WordPress?

cURL error 28 in WordPress occurs when the server fails to respond to data requests within the expected time frame.

WordPress utilizes the REST API, a programming method for sending and receiving data requests. If these requests exceed the time limit, it will result in a significant issue in the Site Health report labeled ‘The REST API encountered an error’.

Clicking on the error will reveal additional information, including the specific error message:

‘Error: cURL error 28: Operation timed out after x milliseconds with x bytes received (http_request_failed)’

You may also encounter another related issue titled ‘Your site could not complete a loopback request’. This will display a similar error message with the following explanation.

‘The loopback request to your site failed, indicating that features dependent on it are currently not functioning as intended.’

What Factors Can Lead to cURL Timing Out?

Several factors can contribute to cURL timing out in WordPress.

For example, a WordPress firewall plugin like Cloudflare might block a REST API request, mistakenly identifying it as suspicious activity.

Additionally, if your DNS server is malfunctioning, it can disrupt HTTP requests and trigger the cURL timeout error in WordPress.

A misconfigured WordPress hosting server may have a low connection timeout setting, which can prevent certain WordPress processes from functioning correctly.

Now, let’s explore how to troubleshoot and fix the ‘cURL error 28: Connection timed out’ issue in WordPress.

1. Temporarily Disable Your WordPress Firewall

If you’re using a WordPress firewall or a security plugin, temporarily disable it.

Next, check the WordPress Site Health report page to see if the issue has been resolved.

If the problem is fixed, review your WordPress firewall logs to identify which API requests were blocked.

This will help you pinpoint the source of the issue, or you can modify the firewall settings to allow legitimate API requests.

2. Deactivate All WordPress Plugins

WordPress plugins and themes make their own API requests to send and receive data. If these requests are too frequent or take too long, they may trigger the cURL error in your Site Health report.

The simplest way to check if your WordPress plugins are causing the problem is to deactivate them.Go to the Plugins » Installed Plugins

page and select all plugins.

You can now check the Site Health report to see if the issue has been resolved. If the problem is fixed, you can begin reactivating your plugins to identify if one of them triggers the error message again.

This process will help you identify the plugin that might be causing the issue, allowing you to reach out to the plugin developer for assistance.

3. Verify That Your Hosting Server Is Running the Latest Software

The next step is to ensure your web hosting server is equipped with the latest versions of PHP, the cURL library, and OpenSSL.

You can verify this by checking the system information tab on the Tools » Site Health page.

Simply navigate to the ‘Info’ tab and expand the ‘Server’ section.

From this section, you can view details about the software installed on your WordPress hosting server.

Ideally, your server should be running PHP version 7.4.13 or higher, cURL version 7.74.0 or higher, and OpenSSL version 1.1.1 or higher.

If your server is not up to date, you will need to contact your WordPress hosting provider and request that they update your server to the latest software versions for your hosting account.

4. Resolve SSL Insecure Content Problems

If your WordPress site uses HTTPS/SSL but is not set up correctly, your web server may block insecure cURL requests.

Conversely, if your WordPress site does not use HTTPS/SSL but attempts to make an API call using an HTTPS URL, those requests will fail, resulting in the following cURL error:

‘Error: cURL error 7: Failed to connect to localhost port 443: Connection refused (http_request_failed)’

To resolve this issue, contact your hosting provider to reinstall the SSL certificate for your website. If the problem continues, refer to our guide on fixing common SSL issues to ensure proper SSL setup on your WordPress site.

5. Reach Out to Your Hosting Provider

If the previous steps do not fix the cURL error 28 on your WordPress site, it is likely an issue with the hosting environment.

Many factors can only be addressed by your hosting company. For example, if their DNS servers cannot resolve requests quickly, this can lead to cURL requests timing out.

Another possibility is slower connectivity or networking issues with your hosting server.

If the issue persists, reach out to your hosting support team by submitting a request that includes the error details. Their technical team will be able to investigate and implement a solution to resolve the problem.

If your current hosting provider is unhelpful, consider switching to a managed WordPress hosting service like SiteGround. With SiteGround, you benefit from 24/7 expert technical support, high-speed servers, and top-notch WordPress security.

We hope this article has helped you understand how to resolve cURL error 28 in WordPress. You may also want to check out our comprehensive WordPress troubleshooting guide and our ultimate resource for fixing common WordPress errors.

If you enjoyed this article, please subscribe to our YouTube Channel for WordPress video tutorials. You can also connect with us on Twitter and Facebook.

Share This Post