Key highlights
- Understanding cURL error 28 and its impact on your website can help you maintain a smooth user experience.
- Simple fixes such as increasing the cURL timeout limit and resolving DNS misconfigurations can quickly improve site performance.
- Advanced troubleshooting, including checking API connectivity, server configurations and SSL settings, enhances your site’s security.
- Preventive measures like regular updates and routine maintenance help prevent recurring issues and keep your WordPress site running optimally.
- Reliable hosting solutions from Bluehost, with expert support and security features, ensure your site remains fast, secure and ready for long-term growth.
Introduction
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, that’s when Error 28 makes its appearance.
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: The remote server might be down or overloaded. If the server is busy or experiencing problems, it may not respond quickly enough.
- 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.
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.
- 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.
- 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. Here’s a step-by-step guide on how to diagnose the issue and fix the cURL error in the simple way (more advanced troubleshooting is below).
- Check server logs
- Review site health
- Disable plugins & themes
- Increase cURL timeout
- Fix DNS settings
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.
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.
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 in 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 resolving 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.
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 if cURL is up to date. An outdated cURL library might have compatibility issues.
Firewall or Security modules: Tools like mod_security or server-level firewalls might be blocking cURL requests. Your hosting provider can check this.
3. Test with WP_DEBUG
1. Add the following code to your wp-config.php file: 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.
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 how a more stable solution.
Bluehost’s high-performance hosting solutions deliver enhanced stability and reliability. Specifically optimized 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.
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. 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.
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.
- 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 jeopardize 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.
- 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 optimizations and best practices. Here are some essential tips to minimize the chances of web host encountering this error:
- Choose Reliable Hosting
- Update Server Software
- Optimize Configuration
- Use a CDN
- Monitor Third-Party Services
- Optimize DNS Settings
- Implement Monitoring
- Limit External Requests
- Use Retry Logic
- Backup Regularly
- Review Firewall Settings
- Keep Everything Updated
- Test in Staging
- 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. Bluehost stands out from the crowd. Here’s why:
Bluehost offers comprehensive hosting plans tailored for your needs:
- 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 optimized 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. Optimize 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. Monitor server resources (CPU, RAM, I/O) and upgrade or optimize as necessary.
4. Use a Content Delivery Network (CDN)
Using a Content Delivery Network (CDN) is a powerful way to boost your website’s performance.
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. 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. Optimize 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. Minimize 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
For crucial external requests, implement retry logic, so that if a request fails, the system will attempt it again after a short pause.
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
Ensure your server’s firewall settings aren’t too restrictive, potentially blocking necessary outgoing or incoming connections.
12. Keep WordPress, themes and plugins updated
Developers frequently release updates that fix known issues and improve compatibility. 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.
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.
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 optimized 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
Dealing with errors like cURL error 28 might be frustrating at first, but once you understand the root causes and learn the fixes, things get a lot easier. 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. It takes care of the heavy lifting by handling performance optimization, 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 occurs when WordPress experiences a connection timeout while communicating with external servers, often due to DNS issues, firewall restrictions, or server overload.
It’s usually caused by slow server response times, DNS misconfigurations, firewall restrictions or outdated PHP settings, all of which delay server communications.
Check your server error logs and use the WordPress Site Health tool to identify REST API issues. Temporarily deactivate plugins and themes to pinpoint conflicts and test external API connectivity to find the error source.
Increase the cURL timeout limit in your wp-config.php file, fix DNS settings and ensure your server software and WordPress installation are updated. These steps can improve response times and resolve the error.
If basic troubleshooting doesn’t fix the issue or you’re uncomfortable adjusting server settings, contact your hosting provider or a WordPress expert for further support.