How to Fix cURL Error 28: Connection Timed Out after 5002 milliseconds in WordPress

It’s one of the most frustrating sights for a WordPress admin: you’re trying to update a plugin, run a health check, or connect to an external service, and you’re hit with a cryptic message: cURL Error 28: Connection Timed Out.

This error, often with a specific time like “after 5002 milliseconds,” can bring your site’s operations to a halt. It can disrupt communication between your site and other services, affecting everything from updates to backups and e-commerce checkouts.

But don’t worry—this is a common problem with clear solutions. In this guide, we’ll walk you through exactly what this error means and how to fix it step-by-step.

What Is a cURL Error 28?

In simple terms, WordPress uses a software library called cURL to send and receive data requests to and from other servers. This is used for checking for updates, communicating with APIs (like your email marketing service or payment gateway), or running the Site Health tool.

A cURL Error 28 means your server sent a request using cURL, but the other server took too long to respond. The “5002 milliseconds” (or any other number) is simply the timeout limit. Your server waited for just over 5 seconds, got no answer, and “timed out.”

This isn’t just an error; it’s a symptom of an underlying communication block.

Common Causes of the cURL Timeout

This timeout can happen for several reasons, but they usually fall into one of these categories:

  • Plugin Conflict: A WordPress plugin, especially a security or firewall plugin, is blocking the cURL request.
  • Firewall Issues: Your web host’s firewall or a cloud-based firewall (like Sucuri or Cloudflare) is mistakenly identifying the request as suspicious and blocking it.
  • Low Server Timeout Limit: Your server’s own configuration is too strict and doesn’t wait long enough for a response.
  • Outdated Software: You are running an old version of PHP, cURL, or OpenSSL, which can cause communication and security issues.
  • SSL or DNS Problems: An issue with your SSL certificate or your site’s DNS settings is preventing a successful connection.

How to Fix cURL Error 28 in WordPress (5 Steps)

Let’s start with the easiest and most common fixes first.

1. Temporarily Deactivate Your Firewall Plugin

Security and firewall plugins (like Wordfence, iThemes Security, or Sucuri Security) are a primary cause of this error. Their job is to block suspicious requests, and they can sometimes be too aggressive, blocking legitimate requests from your own site.

  1. Go to Plugins > Installed Plugins in your WordPress dashboard.
  2. Find your security or firewall plugin.
  3. Click Deactivate.
  4. Now, try to repeat the action that caused the error (e.g., run the Site Health check again).

If the error is gone, you’ve found the culprit! Go into the plugin’s settings and look for any options related to the REST API, cURL, or request blocking. You may need to “allowlist” your own server’s IP address. If you can’t find the setting, contact the plugin’s support team.

2. Deactivate All Plugins to Check for Conflicts

If the firewall wasn’t the issue, another plugin might be to blame. The simplest way to check this is to deactivate all plugins at once.

  1. Go to Plugins > Installed Plugins.
  2. Select all plugins by clicking the checkbox at the top.
  3. From the “Bulk actions” dropdown, select Deactivate and click Apply.
  4. Test again to see if the cURL Error 28 is gone.

If it is, reactivate your plugins one by one, testing for the error after each activation. When the error reappears, you’ve found the plugin causing the conflict. You can then replace that plugin or contact its developer for a fix.

3. Increase Your Server’s Timeout Limit

If the error is “Connection Timed Out,” a logical fix is to increase the timeout limit. The default of 5 seconds (5000ms) might not be enough for some operations.

You can often do this by contacting your hosting provider, which is the safest method. Just ask them to “increase the PHP max_execution_time and cURL timeout limit” for your site.

If you are comfortable editing files, you can try one of these methods:

  • Edit .htaccess: Add this line to your .htaccess file in the root of your WordPress installation:
    php_value max_execution_time 300
  • Edit wp-config.php: Add this line just before the /* That’s all, stop editing! */ line:
    set_time_limit(300);

This changes the execution time limit to 300 seconds (5 minutes), which should be more than enough.

4. Ensure Your Server Software is Up-to-Date

Outdated software can lead to all sorts of performance and security issues, including the cURL Error 28. Go to Tools > Site Health in your WordPress dashboard.

Click on the “Info” tab and expand the “Server” section. Check three key things:

  • PHP version: Should be 7.4 or, ideally, 8.0 or higher.
  • cURL version: Should be a modern version (e.g., 7.74.0 or higher).
  • OpenSSL version: Should be 1.1.1 or higher.

If any of these are old or show warnings, contact your hosting provider and ask them to update the PHP, cURL, and OpenSSL versions on your server. This is a standard request they should be able to handle easily.

5. Contact Your Hosting Provider

If you’ve tried all the steps above and are still stuck, the problem is almost certainly on the server side. The issue could be:

  • A server-level firewall blocking requests.
  • A DNS issue preventing your server from resolving addresses.
  • Network issues or rate-limiting on your hosting platform.

At this point, your best bet is to contact your web host’s support team. Send them a message explaining the error message you’re seeing (including “cURL Error 28: Connection Timed Out”) and tell them all the troubleshooting steps you’ve already taken. This will help them diagnose and fix the problem much faster.

Conclusion

A cURL Error 28 can be annoying, but it’s almost always fixable. By following a logical process—checking your plugins, investigating firewalls, and updating your server—you can resolve the communication block and get your site running smoothly again.

Remember to start with the simplest solution (plugins) before moving on to more technical server configurations. And when in doubt, your hosting provider’s support team is your best resource.