cURL error 28 in WordPress means a server-to-server request timed out before a connection could be established. This often breaks REST API calls, plugin updates, or external API integrations. This guide walks you through the most common causes and fixes, from simple plugin checks to server-level configuration changes.
What You’ll Need
- WordPress admin access (or FTP/SFTP if you can’t log in)
- Access to your hosting control panel (cPanel, Plesk, or custom)
- Basic familiarity with editing files (e.g., wp-config.php, .htaccess)
- A text editor (like Notepad++ or VS Code) for file edits
Step-by-Step
1. Identify Where the Error Appears
cURL error 28 can show up in different places: when updating plugins/themes, during a migration, in the Site Health screen, or when using an external API plugin. Note the exact context—it helps narrow down the cause. For example, if it only happens during plugin updates, the issue is likely with the WordPress update process, not your site’s front end.
2. Temporarily Deactivate All Plugins
Plugins are the most common trigger. Go to Plugins → Installed Plugins, select all, and choose Deactivate from the bulk actions dropdown. If you can’t access the admin, rename the plugins folder via FTP to plugins_off. If the error disappears, reactivate plugins one by one to find the culprit. Once found, update or replace that plugin.
3. Switch to a Default WordPress Theme
A poorly coded theme can also cause timeouts. Temporarily switch to a default theme like Twenty Twenty-Four. If you can’t access the admin, rename the theme folder in wp-content/themes/ via FTP. If the error goes away, the theme is the issue—update it or contact its developer.
4. Increase the PHP Execution Time
cURL timeouts often happen because PHP scripts are killed before the request completes. Add this to your wp-config.php file just before the /* That's all, stop editing! */ line:
set_time_limit(300);
This sets a 5-minute limit. You can also try editing php.ini (if you have access) and changing max_execution_time to 300. After saving, test again.
5. Adjust cURL Timeout Settings
Some plugins or themes have their own cURL timeout settings. If you’re comfortable adding code, you can increase the default timeout for all cURL requests by adding this to your theme’s functions.php or a custom plugin:
add_filter('http_request_timeout', function($timeout) { return 300; });
This sets the timeout to 300 seconds. If the error persists, also try adding add_filter('http_request_args', function($args) { $args['timeout'] = 300; return $args; }); to the same file.
6. Check Your Firewall and Security Plugins
Security plugins like Wordfence or Sucuri can block outgoing requests that look suspicious. Temporarily disable any security or firewall plugin and see if the error stops. Also check your hosting’s firewall settings—some hosts block certain IPs or ports. Whitelist the IP addresses that WordPress needs to connect to (e.g., api.wordpress.org).
7. Verify DNS and Server Connectivity
Sometimes the server simply can’t reach the target. Use your hosting control panel’s terminal (or SSH) to run:
curl -I https://api.wordpress.org
If this times out, your server has a network issue. Try pinging the domain: ping api.wordpress.org. If DNS fails, check your server’s DNS settings in /etc/resolv.conf or contact your host.
8. Update WordPress, Plugins, and PHP
Outdated software can have bugs that cause timeouts. Ensure WordPress is updated to the latest version, and update all plugins and themes. Also, check that your PHP version is supported (WordPress recommends PHP 7.4 or higher). You can update PHP from your hosting control panel.
9. Contact Your Hosting Provider
If none of the above work, the issue is likely on the server side. Many shared hosts have strict outbound connection limits. Contact support and explain that you’re getting cURL error 28, and ask them to check if outgoing connections are being blocked or throttled.
Common Mistakes
- Deactivating plugins without testing: Deactivate all, then reactivate one by one. If you skip this, you won’t know which plugin caused it.
- Editing the wrong file: Make sure you’re editing
wp-config.phpin the root of your WordPress installation, not a backup or a different site. - Not clearing cache: After making changes, clear any caching plugin and server-side cache (like Varnish or CDN) to ensure you’re testing the new settings.
- Ignoring the error context: The fix for a timeout during plugin updates may differ from one during a payment gateway API call. Always note where the error appears.
Tips
- Use a staging site to test fixes before applying them to your live site.
- Keep a backup of your
wp-config.phpandfunctions.phpbefore editing. - If you’re using a CDN, temporarily bypass it to rule out CDN-related timeouts.
- Check your server’s error logs (often in
logs/or via cPanel) for more details about the timeout. - Consider using a plugin like WP Crontrol to test cron events, as timeouts often occur during cron-triggered requests.
Troubleshooting
If the error persists after all steps:
- Check if the issue is specific to your network: try connecting from a different IP or using a VPN.
- Look at your server’s firewall rules (if you have root access) to see if outbound connections on port 443 are blocked.
- Test with a minimal setup: disable all plugins and switch to a default theme, then try a simple cURL request from the server to an external site.
- If you’re using a managed WordPress host, they may have a plugin or setting that controls outgoing requests—check their documentation.
- Consider increasing the cURL timeout in your PHP configuration via
php.ini:curl.cainfoisn’t relevant, butdefault_socket_timeoutcan be increased to 60 or 300.
Frequently Asked Questions
What does cURL error 28 mean exactly?
It means a cURL request timed out—the server took too long to respond, or the connection couldn’t be established within the set time limit.
Why does cURL error 28 happen only when I update plugins?
Plugin updates require WordPress to connect to the WordPress.org API. If your server blocks or slows that connection, the update process times out. It’s often due to firewall or DNS issues.
Can cURL error 28 be caused by a slow internet connection?
No, it’s a server-side issue. Your local internet speed doesn’t affect server-to-server requests.
Will increasing the timeout always fix the problem?
Not necessarily. If the remote server is down or unreachable, a longer timeout just delays the error. It helps only if the request is slow but eventually succeeds.
Is it safe to edit wp-config.php?
Yes, if you make a backup first. A small syntax error can break your site, so always keep a copy and revert if needed.
What if I can’t access the WordPress admin at all?
Use FTP to rename the plugins folder or switch themes. If the error prevents the admin from loading, those steps can restore access.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- China’s IPv9 Decimal Network Project Explained
- Fix Wired Earbuds That Only Work in One Ear
- What to Check Before Buying the Dip in Indian Shares
- Cool Raspberry Pi Projects: 15 Ideas for Any Skill Level3
- Terraform vs Kubernetes: Key Differences
- Internet Connectivity in Remote Areas: Options0.80 USD/GB