Key highlights
- Understand cURL error 28 and its impact on maintaining a seamless user experience on your website.
- Apply simple fixes like increasing the cURL timeout limit and resolving DNS misconfigurations to improve site performance quickly.
- Conduct advanced troubleshooting such as checking API connectivity, server configurations and SSL settings to enhance your site’s security.
- Implement preventive measures like regular updates and routine maintenance to avoid recurring issues and keep your WordPress site running smoothly.
- Choose reliable hosting solutions from Bluehost, offering expert support and robust security, to ensure your site stays fast, secure and ready for long-term growth.
So, you’re cruising along with your WordPress site when suddenly, bam! You’re hit with the cURL error 28: Connection Timed Out. What’s going on?
cURL (ClientURL) functions as the intermediary, helping your site communicate with external servers. It fetches updates or sends data to third-party services. When this communication fails, you may encounter an error message like “cURL error 28: Connection Timed Out,” indicating a disruption in your server’s ability to process requests.
The cURL error 28 happens when WordPress sends out a request, but the server fails to respond in time. And we all know how frustrating that can be. But fixing it isn’t as scary as it seems.
In this blog, we’ll explore the causes and various methods to fix the cURL error timeout.
Understanding cURL in WordPress
cURL is a powerful PHP library that lets WordPress communicate with other servers. It plays a crucial role in tasks like fetching updates, interacting with APIs or sending data to third-party services. Without cURL, many of the features you rely on such as automatic updates, connecting with payment gateways or retrieving important data from other platforms simply wouldn’t work as effectively.
What causes cURL error 28 (connection timed out)?
cURL error 28 occurs when your WordPress site waits too long for a response from a remote server. Here are some common causes:
- Server issues: If the server is busy or experiencing problems, it may not respond quickly enough. When the server fails to respond in time, the cURL request times out, which is a common cause of this error.
- Network delays: Slow internet connections or high latency can cause delays. If data takes too long to travel between servers, the connection may time out.
- Firewall or security plugins: Overly strict firewall settings or security plugins can block outgoing cURL requests. This may prevent your site from connecting to other servers.
- DNS problems: Misconfigured DNS settings can stop your site from properly resolving a server’s address. Without the correct address, the connection fails.
- Resource limitations: Your hosting environment might be under heavy load or not equipped to handle many simultaneous requests. This can lead to timeouts as resources get stretched thin. If the operation timed out due to overloaded servers or firewall restrictions, your WordPress site may trigger the cURL error 28.
How to diagnose cURL error 28 in WordPress websites
Diagnosing cURL error 28 involves a few careful steps to pinpoint the issue:
- Enable debugging: Turn on WordPress debugging to capture error logs. These logs provide valuable clues about which requests are timing out and why. Logs can reveal whether a timeout occurred during a cURL call, which is vital for diagnosing this issue.
- Test connectivity: Use command-line tools like cURL to manually test connections to the problematic server. This helps you check if the server is reachable and how long it takes to respond.
- Check firewall settings: Review your server’s firewall and any security plugins. Temporarily disable them to see if the error persists. If the error disappears, your firewall may be too strict.
- Review DNS settings: Verify that your DNS records are correctly configured. Use online DNS lookup tools to ensure your domain is resolved properly. Incorrect settings can delay or block connections. Many of the underlying causes of this error are server related, such as resource limits or misconfigured DNS settings.
- Consult your hosting provider: If you suspect resource limitations or configuration issues, contact your hosting provider. They can check server performance, adjust resource limits and provide additional insights.
Simple ways to fix cURL error 28
Diagnosing ‘cURL error 28 (connection timed out)’ in WordPress websites involves a systematic approach to identify the root cause. Below is a step-by-step guide on how to fix connection timed out error in WordPress using simple, beginner-friendly methods.
1. Check server error logs for timeouts
Before delving deep into troubleshooting, check your server’s error logs. These logs might have more details regarding the last timeout error or any other issues causing the error message.
2. Check WordPress site health for REST API issues
WordPress 5.2 and later versions come with a Site Health tool:
1. Go to ‘WordPress Dashboard’ > ‘Tools’ > ‘Site Health’
2. Check the ‘critical issues’ or ‘recommended improvements’ sections to see if there are any relevant alerts.
The Site Health tool can also reveal issues with REST API request failures that may be linked to this timeout error.
3. Deactivate plugins & themes
WordPress Plugins and themes are common culprits:
Temporarily disable all the WordPress plugins. You can do this using the ‘bulk actions dropdown menu’ in the WordPress dashboard.
Another method is by renaming the plugins folder in wp-content via FTP.
Check if the error reappears. If it doesn’t, reactivate each plugin one by one until you find the offending plugin.
Try to temporarily disable firewall protection to see if it’s blocking outbound connections or REST API communications.
Switch your theme to one of the default WordPress themes (like Twenty-Twenty or Twenty- Twenty-One). Check if the issue persists.
4. Increase cURL timeout limit in WordPress
If your site frequently experiences cURL timeout errors, try increasing the cURL timeout limit.
You can do this by adding a custom timeout parameter to your theme’s functions.php file or via a custom plugin.
For example, setting the timeout to 60 seconds can provide extra time for slow responses. Always test after making this change to ensure everything works smoothly.
5. Fix DNS issues
DNS misconfigurations can also lead to cURL error 28. Verify your DNS settings to ensure your domain is resolved correctly.
- If you have SSH access to your server, you can use commands like ping, dig or nslookup to test DNS resolution.
- Check with your hosting provider to ensure there aren’t any ongoing DNS issues.
Consider switching to a reliable public DNS service like Google DNS or Cloudflare DNS for improved performance. If issues persist, consult your hosting provider to troubleshoot and resolve any underlying DNS problems.
Also read: How to fix DNS Server Not Responding error
Advanced troubleshooting to fix cURL error 28
If the basic troubleshooting steps above didn’t fix the cURL error 28 (connection timed out), these advanced tactics should help.
1. External API connectivity
If a plugin or your theme is trying to connect to an external API:
Confirm if the API endpoint is correct and that the API is operational. You might need to contact the service provider.
If the server fails to deliver a response in time, especially when querying APIs, the request will be dropped.
Test the API using tools like Postman or simply your browser (if it’s a GET request) to ensure its responsiveness.
2. Server configuration
- PHP version: Ensure you’re running a version of PHP that’s compatible with your WordPress version, plugins and themes.
- Increase PHP default_socket_timeout: Adjust this in the php.ini file or ask your hosting provider to do it.
- cURL version: Check your cURL version via command line or phpinfo; outdated versions may lack support for certain protocols.
- Firewall or Security modules: Tools like mod_security or server-level firewalls might be blocking cURL requests. Your hosting provider can check this.
Server-level firewalls or plugins like ModSecurity may be blocking requests, causing them to fail silently.
3. Test with WP_DEBUG
define (‘WP_DEBUG’, true);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, false);
2. This will enable error logging to a debug.log file inside the wp-content folder. Reproduce the issue, then check the log for any relevant error messages.
4. Test on a different hosting environment
Sometimes, local development environments or specific servers might have unique configurations, causing the error:
- Try cloning your WordPress website to a staging environment or a different server/host.
- Test to see if the error persists there.
If none of these steps lead to a solution, it might be a more intricate issue requiring deeper server-level diagnosis or consultation with web development experts. Always remember to take backups before making any significant changes to hosting server.
Testing on a different environment can help rule out server related factors such as hosting-specific firewalls or resource limits.
Sometimes local development environments or specific servers might have unique configurations causing the error. If you’re running on a host with variable performance, consider a more stable solution.
Our high-performance hosting solutions deliver enhanced stability and reliability. Specifically optimised for WordPress, Bluehost ensures fast speeds, robust security and consistent uptime, even during traffic surges or when dealing with technical challenges. This makes it an ideal choice to keep your site running smoothly.
5. Check SSL certificate and verify HTTPS settings
Ensure your SSL certificate is active and correctly configured. Verify that your website is fully served over HTTPS by checking for any mixed content issues.
- Log in to your hosting dashboard and check the status of your SSL certificate.
- Use an online SSL checker tool (like SSL Labs) to scan your website for any issues.
- Verify that your site loads over HTTPS without mixed content warnings by checking your browser’s console.
This guarantees a secure connection for your visitors and prevents security warnings that might disrupt user trust.
Use browser developer tools to inspect whether the timeout occurred during SSL negotiation or certificate verification.
Also read: SSL Certificate Guide: Types, Benefits & How to Get One
6. Whitelist API endpoints in security plugins & firewall
Security tools can sometimes block important API endpoints, causing features to break. Overzealous firewalls could be blocking requests to third-party services—whitelisting trusted APIs resolves this.
Whitelisting these endpoints ensures your site can communicate with external services without interruption.
- Review the settings in your security plugins and firewall software.
- Identify any API endpoints that are essential for your website’s functionality.
- Add these endpoints to your whitelist.
- Test your site to confirm that all features are working properly.
7. Update PHP, WordPress core and server software
Keeping your software updated is crucial for performance, compatibility and security. Regular updates fix bugs and close security vulnerabilities.
- Check your current PHP version in your hosting control panel and compare it with the latest recommended version.
- Update WordPress core through the dashboard or by following the official update guide.
- Update server software via your hosting provider’s panel or by contacting support if necessary.
Running outdated software can lead to security flaws and performance bottlenecks, which may trigger timeout errors.
Always create a full site backup before performing any updates. After updates, test your site to ensure everything functions as expected.
Also read: WordPress PHP Versions: How to Update Your Settings
When to seek professional help for cURL error 28 issues?
If you’ve tried the above solutions and are still encountering cURL error 28, it may be time to seek professional help. WordPress experts or your hosting company support team should be able to assist.
Deciding when to seek professional help for a cURL error 28 (connection timed out) may be a good idea depending on the following factors:
- Experience level: If you’re not comfortable with troubleshooting server configurations, file edits or diagnosing PHP errors, it’s a good idea to seek professional help early in the process.
- Business impact: If your website is crucial for your business or has significant traffic, even a small mistake during troubleshooting can be costly. In such cases, it’s often better to consult a professional right away.
- Duration of the issue: If the error has been occurring for an extended period and isn’t just a transient issue, professional intervention might be needed. If the error message keeps reappearing after multiple fixes, it’s time to bring in technical support.
- Elimination of basic causes: If you’ve gone through basic troubleshooting steps such as deactivating plugins, switching themes, checking with your hosting provider and the issue persists, it might be time to escalate.
- Server access: Some diagnostic steps require server or SSH access and if you’re unfamiliar with command-line tools or server configurations, it’s better to have an expert handle it.
- Potential external causes: If you suspect that the issue might be related to an external service, API or third-party integration (and especially if it’s critical to your website’s operation), a professional might be better equipped to diagnose and liaise with the third-party provider.
- Risk assessment: If you feel that a potential solution might jeopardise your site’s security, data integrity or uptime, consult a professional before taking action.
- Recurring issues: If cURL error 28 or other similar issues recur even after you’ve addressed them previously, it suggests there might be a deeper, underlying problem that requires expert attention. Professionals may also help safely temporarily disable firewall protection without compromising your site’s integrity.
- Complex configurations: Websites with custom configurations, integrations or bespoke code might behave differently than standard WordPress installations. In such cases, generic solutions might not apply and an expert’s eye would be beneficial.
In essence, if you ever feel out of your depth, it’s better to seek professional help rather than trying to recover from a misstep.
15 tips to prevent cURL error 28
Preventing cURL error 28 (connection timed out) involves a combination of proactive monitoring, server optimisations and best practices. Here are some essential tips to minimise the chances of web host encountering this error:
- Choose Bluehost hosting provider
- Keep server software updated
- Optimise server configuration
- Use a Content Delivery Network (CDN)
- Monitor third-party services
- Optimise DNS settings
- Implement monitoring and alerts
- Limit external requests
- Implement retry logic
- Backup WordPress website regularly
- Review firewall settings
- Keep WordPress, themes and plugins updated
- Test in staging environment
- Follow good coding practices
- Stay informed
1. Choose Bluehost hosting provider
Opt for a reputable hosting company known for reliable uptime, good server response times and top-notch customer support. A solid hosting environment helps avoid server timeouts, ensuring reliable performance even during high load.
Bluehost hosting solutions stand out from the crowd. Here’s why:
- Shared hosting: Ideal for small to medium websites, Bluehost Shared hosting features an easy-to-use cPanel, free domain registration for the first year, unmetered bandwidth and one-click installations. It’s perfect for beginners needing a dependable foundation without server management hassles.
- Managed WordPress hosting: Designed specifically for WordPress sites, Managed WordPress hosting delivers optimised performance with automatic updates, enhanced security and expert support. It lets you focus on content while leaving the technical details behind.
- VPS hosting: For growing websites that need more power, VPS hosting offers dedicated resources, scalable performance and full root access. It strikes a balance between shared hosting and dedicated servers, ensuring speed and reliability as your business expands.
- Dedicated hosting: When you require maximum control and top performance, Dedicated hosting provides an entire server just for you. It’s ideal for high-traffic sites and large enterprises.
- Cloud hosting: Built for scalability and high availability, Cloud hosting automatically adjusts resources based on your traffic. This flexible solution ensures consistent performance, even during traffic spikes.
No matter which plans you choose, Bluehost is committed to keeping your website up and running, so you can focus on growing your business.
2. Keep server software updated
Ensure server software, including cURL, PHP and your web server (like Apache or Nginx), is up-to-date. Updates often include performance enhancements and security fixes.
These updates often include bug fixes and compatibility adjustments that ensure your site operates smoothly with the latest technologies, ultimately leading to faster load times and a more reliable user experience.
3. Optimise server configuration
Adjust PHP settings, such as default_socket_timeout, to appropriate values based on your website’s needs. In addition, make sure your server isn’t overloaded. If your server’s HTTP request limit is too low, it may drop long-running requests prematurely.
Avoid server related slowdowns by monitoring RAM, CPU usage and I/O load regularly.
4. Use a Content Delivery Network (CDN)
Using a Content Delivery Network (CDN) is a powerful way to boost your website’s performance.
CDNs reduce strain on your origin server, helping avoid exceeding the server’s HTTP request limit.
A CDN helps offload server requests, decrease latency and speed up connections for users worldwide. This means faster load times, smoother browsing experiences and reduced strain on your primary server
5. Monitor third-party services
If your site relies on third-party services or APIs, monitor their uptime and performance. Delays from server related problems on the external side can still affect your site’s API calls. Choose reliable service providers and be ready to switch if they become a bottleneck.
By regularly tracking their uptime and performance, you can quickly pinpoint potential issues that might disrupt your site’s functionality.
6. Optimise DNS settings
Use a reliable DNS provider. Consider reducing the Time To Live (TTL) for DNS records if you’re making frequent changes but avoid extremely low values unless necessary.
7. Implement monitoring and alerts
Use monitoring tools to track your site’s uptime, server health and response times. Set up alerts to notify you of potential issues before they escalate.
8. Limit external requests
Every external request adds a potential point of failure. Too many external dependencies increase the risk that an operation timed out due to bottlenecks.
Minimise the number of plugins or themes that rely on external services. If such requests are essential, ensure they have an appropriate timeout period and error handling.
9. Implement retry logic
Retry mechanisms are particularly useful when dealing with server timeouts caused by temporary overloads. If the server’s HTTP request limit is reached, retry logic can help manage failed connections gracefully.
10. Backup WordPress website regularly
While backups won’t prevent cURL error 28, they will ensure you can quickly recover if something goes wrong during troubleshooting or if an issue persists.
11. Review firewall settings
Firewalls should be configured carefully to avoid blocking requests essential for core WordPress functions.
If needed, temporarily disable firewall protection to test whether it’s interrupting legitimate API traffic.
12. Keep WordPress, themes and plugins updated
Developers frequently release updates that fix known issues and improve compatibility. Many issues arise from outdated software that no longer supports secure or fast connections.
Regularly updating reduces the chances of encountering errors.
Yet, manually managing these updates can be time-consuming. To make this process even easier Bluehost WonderSuite helps manage these updates in a breeze. WonderSuite seamlessly integrates into your experience, swiftly automating updates for your WordPress core, themes and plugins. With its AI-powered guidance and step-by-step support, it not only keeps your site secure and performing at its best but also helps you build a stunning website that truly reflects your vision.
13. Test in staging environment
Before making significant changes or updates on your live site, test them in a staging environment to catch potential issues. Testing in staging helps spot any “operation timed out” errors before they affect your live site.
Many hosting providers offer staging tools that let you create a clone of your website, so you can safely implement and review changes before they go live.
14. Follow good coding practices
If you’re developing custom plugins or themes, ensure good coding practices. Proper error handling, efficient code execution and adhering to WordPress coding standards can reduce the likelihood of issues.
15. Stay informed
Regularly check with the WordPress community, plugin/theme developers and hosting providers for any known issues or recommended best practices. Furthermore, being unaware of outdated software can result in missed critical patches that lead to errors like cURL 28.
Importance of regular WordPress maintenance
Regular maintenance of a WordPress website is critical to the success of your online store or blog. At the forefront of its importance is security. Given WordPress’s popularity, it is frequently targeted by hackers. Consistent updates to the core platform, plugins and themes ensure that known vulnerabilities are patched, safeguarding the site against malicious attacks.
The wide world of web technology means that software components may have bugs or glitches. Regular updates often come with bug fixes, ensuring the website operates smoothly and provides an optimal user experience for visitors.
Lastly, as the digital world evolves, keeping WordPress updated ensures compatibility. With new plugins and changing web standards, regular updates and testing help all parts of your website work smoothly together.
To simplify this ongoing process, Bluehost Managed WordPress hosting offers expert maintenance assistance, taking the hassle out of routine updates. It features robust security measures, fast SSD storage, built-in caching and a CDN for optimised performance, perfect for a heavy traffic website.
Other common WordPress errors and fixes
WordPress is a powerful platform, but like any complex system, it does sometimes encounter issues. Below are some other common WordPress errors along with simple fixes to help you quickly diagnose and resolve these problems:
Error establishing a database connection
Database connection error occurs when WordPress can’t connect to your database. It may be caused by incorrect database credentials, corrupted database files or server issues. To fix it, verify your database login details in the wp-config.php file, consider repairing your database via phpMyAdmin or WordPress’s built-in repair mode and contact your hosting provider if necessary.
- Verify database credentials: Open your wp-config.php file and ensure the database name, username, password and host are correct.
- Check for corrupted files: Use a tool like phpMyAdmin to check your database for corruption or restore from a backup if necessary.
- Contact your hosting provider: If the issue persists, there may be a server-side problem. Your hosting provider can help diagnose and fix the issue.
If your WordPress website is hosted by Bluehost, you can always rely on our 24/7 support service. Our team of experts is available around the clock to help resolve technical issues and ensure your site remains secure and fast.
Also read: How to Fix the Error Establishing a Database Connection in WordPress
504 gateway timeouts
A 504 gateway timeout happens when your server doesn’t receive a timely response from an upstream server. This can be due to heavy traffic, slow server response or misconfigured server settings.
- Check your server logs to identify any resource bottlenecks or patterns causing delays.
- Use caching plugins or server-level caching to reduce server load and improve response times.
- Adjust the timeout settings in your hosting control panel or via your .htaccess file to allow more time for server responses.
If the problem continues, your provider might be able to offer more robust solutions or upgrade your server resources.
Also read: 504 Gateway Timeout Error: 8 Possible Fixes
WordPress memory exhausted error
This error indicates that WordPress has exceeded the PHP memory limit allocated to it. To resolve this, increase the PHP memory limit by adding a line like define(‘WP_MEMORY_LIMIT’, ‘256M’); to your wp-config.php file.
Additionally, review and disable any resource-intensive plugins or scripts and if necessary, consult your hosting provider to adjust your server’s memory allocation.
Also read: 3 Most Common WordPress Issues and Their Solutions in 2024
Final thoughts
Mastering how to fix connection timed out error in WordPress gives you control over your site’s stability and performance. With a bit of regular maintenance and some basic troubleshooting know-how, you can keep your WordPress site running like a well-oiled machine.
Even the best websites hit a few bumps along the road. It’s all part of the journey. And if all this technical mumbo jumbo starts to feel overwhelming, there’s no shame in getting a little help.
Bluehost WordPress Hosting offers a comprehensive, managed hosting environment tailored for WordPress sites. We take care of the heavy lifting by handling performance optimisation, security enhancements and routine maintenance tasks. This ensures your website remains secure, operates at peak speed and is prepared to handle increased traffic.
Ready to take the stress out of managing your site? Get Bluehost WordPress hosting that can give you the freedom to do more of what you love.
FAQs
cURL error 28 is a connection timeout issue that occurs when WordPress tries to reach an external server but fails due to delays. It typically stems from network issues, low timeout limit settings or a server’s firewall blocking requests.
The cURL library enables your WordPress site to send and receive data to and from external servers. If the data transfer process is interrupted—due to plugin conflicts, server timeouts or incorrect SSL configuration—you may see cURL error 28.
A timeout occurred when your site failed to get a response within the defined timeout limit. This could be due to server limits, a low timeout value in your settings or issues like the hosting server being overloaded.
Yes, plugin conflicts or poorly coded themes may trigger timeouts or block requests. Try deactivating WordPress plugins and switching themes one by one to isolate the issue.
Your server’s firewall or a security plugin may block outbound HTTP requests, especially to unknown IP addresses. To fix this, check firewall settings and whitelist trusted API endpoints.
You can fix connection timeout errors by increasing the timeout limit in your site’s code, checking the server’s firewall, updating software or resolving DNS and SSL-related issues.
Absolutely. A low timeout limit often causes the server to drop requests prematurely. Increasing the timeout value gives your server more time to complete HTTP request cycles.
Yes, an aggressive firewall feature may mistakenly block valid cURL requests, resulting in a site failed to connect message. Temporarily disabling or adjusting the firewall can help.
Effective troubleshooting methods include checking error logs, testing external API endpoints, updating your SMTP plugin (if mail is affected) and confirming your client URL setup in WordPress.
Choose a reliable hosting provider like Bluehost, maintain server software and monitor traffic to avoid server-related performance drops or server timeouts.
The most effective troubleshooting methods include enabling debug logs, checking API connectivity, testing firewall rules and verifying server configurations. These steps help uncover root causes behind timeouts, blocked connections or failed requests.
Yes, you can prevent server timeouts and avoid “operation timed out” errors by increasing your timeout limit, optimising server performance and reducing external HTTP requests that may overload your system.
An incorrect SSL configuration can block secure connections to external servers, causing the cURL request to fail or timeout. Always verify your SSL certificate status and ensure your website is fully served over HTTPS without mixed content issues.
You can temporarily disable firewall settings to check if they’re blocking legitimate HTTP requests or API endpoints. If the error disappears, refine your firewall rules instead of leaving it disabled to maintain security.
Outdated cURL versions may lack compatibility with modern security protocols or APIs. Always check the cURL version installed on your server and update it if needed to maintain stable connections and avoid timeouts.
Write A Comment