Addressing WordPress’s ‘ERR_CONNECTION_TIMED_OUT’ Error

Illustration of a Clock

If you’ve ever been faced with the ERR_CONNECTION_TIMED_OUT error in WordPress, you know how frustrating it can be. While it’s a common issue, its complexity can leave website owners feeling overwhelmed. Understanding this error allows users to diagnose and resolve issues effectively.

The ERR_CONNECTION_TIMED_OUT error can happen when attempting to access a website. It means your browser waited too long for a response from the server, leading to the web page’s failed loading.

This error is classed as a network timeout issue. In simpler terms, it indicates that the server you’re trying to reach is not responding within the anticipated time window. There are several common culprits behind this. For example, it could be due to slow internet connections, server overload, hosting issues, network configuration problems, or even high traffic volumes overwhelming the server’s capacity.

Connection Has Timed Out Error Message
Time Out Error Messages in Different Browsers

This particular error can look different depending on the web browser you’re using. Some browsers will show the error message clearly, while others might say that the server isn’t responding, took too long to reply, or that the connection timed out. This inconsistency can make it tricky to figure out and fix the problem.

How Website Owners Can Fix the Error

You can identify and address the underlying causes, ensuring uninterrupted access to your WordPress website. In the following sections, we’ll take you through how to do so, step by step.

Step 1: Rule Out Non-WordPress Configuration Issues

Before getting into WordPress-specific troubleshooting, it’s important to make sure that the error isn’t caused by external factors. Firstly, check Down For Everyone Or Just Me. If this isn’t the answer, here’s how you can rule out non-WordPress configuration issues:

  • Check internet access: Verify the stability and speed of your internet connection to rule out connectivity issues.
  • Check your browser: Test accessing the website using a different browser to determine if the problem is browser-specific.
  • Clear browser cache: Clearing cache and cookies can resolve loading issues caused by outdated data.
  • Check for security measures: Temporary disable firewall or antivirus settings to check if they’re blocking website access. Remember to re-enable them afterward.
  • Check and adjust DNS settings: To improve reliability, modify DNS servers. Follow these steps on Windows to change DNS settings (by using providers like Google Public DNS or OpenDNS) and flush the DNS cache.
  • Verify domain DNS settings: Make sure DNS records are correctly configured to point to the right servers or services. Use DNS tools to check for proper propagation of changes.

By ruling out these non-WordPress configuration issues, you can narrow down the potential causes of the ERR_CONNECTION_TIMED_OUT error and proceed with targeted troubleshooting.

If you’re looking for a temporary solution, you can implement one of the following.

Step 2: Check Maximum Execution Time (Bandage)

The maximum execution time setting helps determine how long PHP scripts are allowed to run on a website. When scripts exceed this time limit, the server terminates them, potentially causing the ERR_CONNECTION_TIMED_OUT error. Adjusting the maximum execution time is a temporary workaround rather than a permanent fix. If a script consistently hits the execution time limit, it indicates there are likely deeper performance issues that need to be addressed — the root causes are typically something like unoptimized code, inefficient database queries, and lack of caching.

Maximum execution time refers to the duration, typically set by the hosting provider, within which PHP scripts are permitted to run. The default maximum execution time is often around 30 seconds, but it can vary depending on server configurations. To adjust the maximum execution time:

Using php.ini File

The php.ini file is a configuration file used to customize PHP settings. If you’re unsure how to find it, you can use the phpinfo() function to find it. Create a PHP file (e.g., phpinfo.php) with:

<?php
phpinfo();
?>

Then, upload this file to your web server’s document root directory (often named public_html, htdocs, or www). Access the file through a web browser (e.g., http://yourdomain.com/phpinfo.php). On the resulting page, look for the Loaded Configuration File section. It will display the path to the php.ini file currently in use.

If you do this, make sure to remove the file when you’re done as it potentially exposes sensitive information.

Now, navigate to the file using SFTP and you can edit. Here’s how to modify the maximum execution time setting:

max_execution_time = 300 ; // This sets the maximum execution time to 60 seconds

You can set this value at runtime within your PHP scripts using the set_time_limit() function. This approach is useful if you need to adjust the execution time for specific scripts or if you don’t have direct access to the php.ini file:

set_time_limit(60); // Sets the maximum execution time to 60 seconds for the script

Using .htaccess for Apache Servers

If you’re using an Apache server, you can adjust the maximum execution time setting. Follow these steps:

  1. Find the php.ini file. The location may vary based on your server setup:
    1. For Linux-based servers:
      1. If you’re using a LAMP (Linux, Apache, MySQL, PHP), you can often find php.ini in /etc/php/ directory. The exact location may vary based on your distribution and PHP version. For example, it might be in /etc/php/7.X/apache2/php.ini for PHP 7.X (where X is the specific version number) on Apache.
      2. Alternatively, you can use the command php –ini in the terminal to find the location of the loaded php.ini file.
    2. For Windows-based servers:
      1. If you’re using XAMPP, WAMP, or a similar package, you can find php.ini in the PHP installation directory. For example, it might be in C:\xampp\php\php.ini for XAMPP.
      2. You can also search for php.ini using Windows search functionality if you’re unsure where it’s located.
  2. Open the php.ini file in a text editor with administrative privileges.
  3. Look for the line that starts with max_execution_time. If it’s not present, you may need to add it manually.
  4. Adjust the numeric value after the max_execution_time directive to set the timeout duration in seconds. For example: max_execution_time = 300 sets the timeout to 300 seconds (5 minutes).
  5. Find the balance between setting a timeout that avoids script timeouts while not excessively tying up server resources.
  6. Save the changes and restart the Apache server through your server’s control panel or via the command line.

    By adjusting the max_execution_time setting appropriately, you can reduce the likelihood of encountering script timeouts and the ERR_CONNECTION_TIMED_OUT error on your WordPress site.

    Step 3: Increase Your Site’s Memory Limit (Bandage)

    Insufficient memory allocation can also be a factor. Here’s how you can increase your site’s memory limit to potentially resolve the issue:

    1. Edit the wp-config.php file:

    • Access your wp-config.php file via SFTP or your hosting provider’s file manager.
    • Add the following line of code:
    define('WP_MEMORY_LIMIT', '256M');
    • This line sets the WordPress memory limit to 256MB. Adjust the value based on your site’s requirements and your hosting environment’s limitations.

    2. Update the .htaccess File:

    • Modify the .htaccess file located in the root directory of your WordPress installation.
    • Add the following line to increase the PHP memory limit for sites hosted on Apache servers:
    php_value memory_limit 256M
    • Note that shared hosting environments may restrict modification of PHP settings via .htaccess. If so, contact your hosting provider.

    3. Troubleshooting:

    If increasing the memory limit does not resolve the error, further troubleshooting may be necessary. Consult with your hosting provider for assistance in diagnosing and resolving the issue.

    If you’re a Pressable customer, you don’t need to worry about maximum memory limits: We’ll handle this all for you! For more information, check out this knowledge base article on PHP memory limitations.

    If these sticking plasters fail, move on to more permanent solutions.

    Step 4: Turn Off Your WordPress Theme

    A malfunctioning WordPress theme can be the culprit behind the ERR_CONNECTION_TIMED_OUT error. Themes, while making your site look nice, can also introduce code conflicts or compatibility issues, leading to connection timeouts.

    To deactivate a WordPress theme, follow these steps:

    1. Go to your website files: Use the host File Manager or an SFTP client like FileZilla to access your site’s files securely.
    2. Go to the theme directory: Once in the files, find the /wp-content/themes/ directory. Here, you’ll find folders corresponding to each installed theme.
    3. Rename the active theme folder: Identify the folder for your active theme and rename it. Adding “_old” to the end of the folder name is a simple yet effective approach (e.g., yourtheme_old). This action effectively disables the theme.
    4. Go to your site: WordPress will fail to locate the current theme and automatically revert to one of the default themes, such as Twenty Twenty-Four, if available.
    5. Check for errors: With the default theme activated, monitor your site for this error. If the error resolves, the deactivated theme is likely the culprit. If the error persists, further investigation into other potential causes is warranted.

    Please note: This will deactivate your WordPress theme, so if you need to take this step, you’ll need to be prepared to re-design your site. Proceed with caution, especially if you’re working on a live site, and be prepared with a backup/temporary emergency theme.

    Step 5: Test Your Plugins for Issues

    Problematic plugins can often be the cause of the ERR_CONNECTION_TIMED_OUT error on your WordPress site. Remember, if you can’t access your site at all due to the error, you can disable plugins using an SFTP client like FileZilla. To do so, follow these steps:

    1. Find the root folder of your WordPress installation, commonly named public_html, public, www, or your site’s name.
    2. Open the wp-content directory and find the folder named plugins. Temporarily rename this folder to “plugins.off.” This action prevents WordPress from accessing your plugins.
    3. Attempt to access your site again. If the site loads without the error, a plugin is likely causing the issue.
    4. To determine which plugin is the culprit, revert the folder name to “plugins” and open it.
    5. Disable each plugin one by one by adding “.off” to the end of each plugin’s folder name. Reload the site after each plugin is disabled to check if the error persists.
    6. Once the site loads without the error, the last plugin you disabled is likely the cause. Investigate this plugin for updates, or consider removing it altogether.
    7. Before making changes on your live site, replicate the issue and any plugin deactivation in a test environment. This ensures that any adjustments don’t cause unforeseen issues for your live site.

    How Pressable’s Managed WordPress Hosting Prevents ERR_CONNECTION_TIMED_OUT Errors

    Pressable’s Managed WordPress hosting is engineered to remove common connectivity issues so your website remains accessible and responsive.

    Our managed WordPress hosting helps prevent connection issues by:

    • Offering unwavering uptime through our WP Cloud infrastructure, guaranteeing your site’s availability to visitors.
    • The platform dynamically scales resources to manage traffic surges, preventing server overloads that can trigger connection timeouts.
    • Our server configuration boosts performance with advanced Edge Cache and CDN technologies, accelerating content delivery while reducing server strain, thus minimizing the risk of connection timeouts.
    • We prioritize security, employing robust web application firewalls and daily backups to fortify against potential threats that could disrupt connectivity.
    • Our dedicated support team is on standby 24/7 to swiftly diagnose and address any connectivity concerns, proactively mitigating issues like ERR_CONNECTION_TIMED_OUT before they impact your site.

    Pressable’s Managed WordPress hosting ensures websites remain consistently accessible and secure. Make the switch to Pressable today and enjoy smooth website operation without the hassle of frequent downtimes or complex troubleshooting processes.

    Varsha Adusumilli

    A dedicated WordPress user since 2007, Varsha has witnessed the platform’s growth and transformations firsthand. With a Masters’ in Computer Science and experience as a web designer/developer, Varsha possesses a strong foundation in various web development technologies. Her entrepreneurial spirit and freelance background further honed her ability to think creatively and deliver results. This deep understanding, coupled with her technical skills and customer-centric approach, makes her a great part of the Pressable Team. Her genuine desire to help others and her knack for finding solutions make her a customer success rockstar.

    Related blog articles