How to Fix WordPress Timeout Updates? [Expert Advice]

Like all systems, WordPress is constantly updated to ensure the secure distribution of applications. Any technician working with the platform will inevitably be confronted with the errors that occur during the update process.

There are often discussions in the WordPress community and forums about why updating a plugin, theme, or the application itself fails and generates errors.

In this article, we will introduce you to the most common WordPress update timeout errors and offer solutions to help you analyze the application's performance.

What Is a WordPress Timeout Error?

The process of updating the WordPress platform (your WordPress website) often takes longer than planned, and this results in a timeout being generated.

This error can increase when various elements of the platform are updated—the themes, plugins, or the core of the system itself.

The reasons for this can be complex. They range from reaching insufficient server limits or other required resources to needing more time for an update process than the server allows.

If a timeout error is generated, the server determines the complete execution of the update in order to reach the maximum execution time of the server.

If the started updates are not carried out, this would jeopardize the operation of the WordPress site, which would also lead to conflicts between the elements themselves, as the update is incomplete and unfinished.

To solve this case, it is often necessary to set up server parameters, optimize your website, and set a priority for updates.

For example, if a kernel update is required but the platform kernel is already old, it is recommended to update the kernel and theme first and then the plugins. It is important to proceed in this order, as plugins often change core files.

What Causes WordPress Timeout Error?

There are several main factors that can cause a timeout error during a plugin, theme ,or core update. The error that is displayed is the following:

There has been a critical error on your website.

timeout error

We will look at the most common factors that cause a timeout:

Not Enough Time to Run the PHP Process

In most cases, a timeout error occurs when the value of the time limit for the execution of the PHP process is not sufficient to perform the update.

This parameter concerns the execution time of the process before it is terminated, and in most cases, the PHP timeout limit is 30 seconds. If this time is not enough to complete the entire update process, it will be canceled without being completed.

PHP Memory Limit

This limit is also extremely important for the execution of the update script, as it is 64M by default, but usually depends on the hosting plans and varies within different limits.

If there's a low PHP memory limit to perform the update, the process is stopped again due to the lack of memory, and an error is generated.

Server Limits

Each hosting provider also imposes such limits at the server level, e.g., a limit on processor time, the number of concurrent processes, database connections, and script execution time. Updates that use these resources can also generate a timeout error.

Limitation of Server Resources

Each server has a limited processing power and a limited memory that cannot be expanded. These parameters determine the performance of the server. If it does not have enough power, this can slow down the update and cause a timeout.

Weak and Irregular Internet Connection

If the network connection between your website and the WordPress update servers is slow or inconsistent, this can also lead to timeout errors.

Large Size of the Update Files

In case the update files are larger in size, this can also generate the error.

Unoptimized Code

Updating plugins and themes with non-optimized code can also slow down the update process, which increases the likelihood of timeouts.

Lack of Resources in the Database

During the update process, the MySQL server is also under load, as the queries to the WordPress database are slower and more extensive. If the server's resources are not designed for such a load, the process can be interrupted again with a timeout error message.

Load on the Server

Interruptions can also be caused by increased data traffic, which fully utilizes the server's resources.

Large Databases

The larger a database is, the more extensive the queries for it are, and the time required to process the query increases proportionally. This inevitably leads to the generation of a timeout error.

File Permissions

In very rare cases, it is possible that the user has changed the server configuration, including the rights of the files. An error occurs during the update for this reason.

Best Practices for Fixing WordPress Timeout Update Error

We will try to cover all possible solutions that could help with the cases listed above—from setting the server parameters to checking if the server has enough resources and if the application code is optimized.

Setting Server Limits

Changing the server settings is one of the keys to solving timeout cases. These settings can help you avoid WordPress update issues.

One of the most important server limits is the execution time of PHP processes. It defines the maximum execution time of a process. If the update script takes longer than the set parameter, the timeout error is always reached.

To set this parameter, you must make a change in the php.ini file for the respective version and set the following parameter:

ini_set( 'max_execution_time', '300' );

This parameter is available for shared Web hosting, WordPress hosting, PrestaShop hosting or OpenCart hosting plans via cPanel in the PHP Selector field on the Options tab for the corresponding PHP version:

The other options for setting this parameter are optional via a directive in the .htaccess file:

After </IfModule>, max execution 300 is added just before #END WordPress.

An alternative to the specified method is to add it directly to the application configuration - wp-config.php

set_time_limit(300);

A higher value ensures that the server terminates the execution of the script and the update runs smoothly and without errors.

Increase of the Memory Limit for Performing Updates

The memory limit for script execution is also important, as is the limit mentioned above.

If the allocated memory, which is 64 MB by default, is too small and the update process requires more, this will inevitably lead to a timeout error.

This parameter can also be changed via the cPanel, PHP Selector field.

3.2. increase of the memory limit for performing updates.

The limit value of this limit can also be added via the application configuration file wp-config.php with the following directive:

define('WP_MEMORY_LIMIT', '64M');

by changing the default value—for example, with 256M or 512M. Such a limit is sufficient to perform most updates.

It is important to know that the specified amount of memory is reserved when each process is opened. We therefore recommend that the values are not very large but sufficient for execution.

Optimize the Server Resources

Optimizing server resources is a radical way to troubleshoot update timeouts.

If you are using a standalone service (virtual server - VPS), you can choose a plan with more CPU time and RAM. This way, you will facilitate the entire process of updating the WordPress platform.

With shared hosting, it is important that the resources are as large as possible so that the long and heavy upgrade scripts can be executed.

In most cases, we will advise you on which plans you can use to make your renewal process as easy as possible.

Remember that you can configure the two parameters mentioned above.

Division of the Upgrade Into Individual Smaller Parts

It is always better to update in stages and release smaller updates one after the other. This way, the server resources are not constantly loaded, and there are not several heavy processes open at the same time, which consumes server performance.

We recommend splitting the update into three phases to avoid timeout errors:

  • WordPress core update
  • Update theme
  • Updating plugins, whereby we can divide them into heavy plugins (Elementor + WooCommerce or most of the WordPress video plugins) and lighter plugins.

This update segmentation approach achieves the following effects:

  • The power consumption of the server is significantly reduced.
  • The update process runs much faster than if all updates were started at the same time.
  • It is easier to find out which element is causing the corresponding error.

Checking the Database Connection

The quality of the database connection is one of the main reasons why the timeout error occurs. If it is slow and unstable, the execution of WordPress updates can slow down and load the MySQL server.

The most important parameter here is the number of simultaneous queries to the database. It is fixed for shared hosting packages, but can be changed for each service.

We can check whether the database connection is active and stable by extracting information about the name of the application database, the user, and the password from wp-config.php and establishing a direct connection to the database.

The shared hosting service has a database limit of no more than 1 GB, as this leads to very large requests and unstable performance of the database itself, as limits such as the 'max_allowed_packet' parameter are reached.

This parameter affects how quickly the update data can be sent to the database. You can check it via the phpMyAdmin of the cPanel by executing the following query:

SHOW VARIABLES LIKE 'max_allowed_packet';

We receive a response from the server about the size of the permitted packets:

If the database is optimized and additional caching tools such as Redis are used, the application update runs smoothly and without a timeout.

If your application is located on a standalone service (virtual server), you naturally have control over all the parameters of the MySQL server and can configure each of them in the configuration file /etc/mysql/my.cnf ( /etc /my.cnf ).

For shared hosting plans, these parameters cannot be changed and are valid for each plan.

Update Themes and Plugins and Deactivate in Case of Errors

Most of the time, timeout errors occur when updating WordPress plugins and themes, and it is important that they are all updated to the latest versions.

To ensure that the update runs smoothly, it is recommended that you first deactivate all plugins and update the theme. With the bulk application feature, we can exclude plugins from the admin console:

To ensure that the update runs smoothly, it is recommended that you first deactivate all plugins and update the theme

After we have deactivated them, we only leave the plugin active that we want to update. In this way, we have freed up resources so that the update runs smoothly and does not cause another error.

It is desirable that plugins are paused regardless of whether we are updating the core or the theme of the app.

Here we also add a command that we can use from the shell to pause and update plugins.

Stop all plugins:

wp plugin deactivate --all

Update all plugins:

wp plugin update --all

Checking Server Logs

To determine where the timeout error is generated, you need to check the information generated in the server logs.

cPanel provides access to these logs via the Metrics field, and the error information in the web server logs is generated via the Errors field.

For more information, see the RAW Access box, which contains an additional example of useful server logs.

where the timeout error is generated - Show server logs

In case of updates and possible timeout errors, it is of course very important to check the PHP log, which in our plans is generated in the working folder of the domain under the name error_log.

Important files are located in two places; one is - /home/cpaneluser/public_html/error_log. This is the log for the front-end application or the visible website.

If an error occurs when updating the administration panel, the information is also recorded in the /home/cpaneluser/public_html/wp-admin/error_log folder.

It is important to have information from both files so that we can analyze the cause of the incident as comprehensively as possible.

Checking File Permissions

In this case, the script attempts to update a file but is not allowed to write to or modify the file and enters a loop of attempts until a timeout error is generated.

To ensure that the upgrade goes smoothly, you can check the folder and file permissions for the WordPress installation.

All folders must have 755 permissions, and all files must have 644 permissions to be accessible. You can check this via the FileManager field in the cPanel.

All folders must have 755 permissions and files must have 644 permissions to be accessible

We can use the rights table to define the required rights if we see that they are not correct:

We can use the table to define the required rights if we see that they are not correct:

Checking the Internet Connection

The internet connection is also an important factor in generating the WordPress update timeout error.

If the connection is stable and fast, your hosting server will connect seamlessly to the WordPress update servers, and the process will run as smoothly as possible.

The quickest way to check the internet connection is to execute a ping command from the command line via the hosting terminal, e.g. to Google's public DNS server, which is most easily accessible at the address 8.8.8.8.

ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=34.2 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=117 time=36.1 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=117 time=36.0 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=117 time=35.5 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=117 time=36.7 ms
--- 8.8.8.8 ping statistics ---

5 packets transmitted, 5 received, 0% packet loss, time 4005 ms

rtt min/avg/max/mdev = 34.181/35.678/36.699/0.845 ms

Summary

In this article, we have examined the most common timeout errors when updating the WordPress platform and the possible reasons for these errors.

We have also pointed out some important points, like how to collect information, analyze it, and solve the particular case related to the error.

Of course, our professional WordPress support team is always available to ensure that your application runs optimally and error-free in our hosting environment.

WordPress Support by Hosting Jump

With attractive support packages, we offer to carry out the described analyses, checks, and measures for you to help you solve the problem with your application, based on our many years of professional experience in supporting the WordPress platform.

However, if it is a challenge for you to look for a solution yourself, we have selected the most popular and most commented cases in the WordPress community that you might encounter in your daily work with the platform. And if you’re experiencing other issues, check out our expert advice on how to resolve the dreadful critical error on WordPress.

Hosting Jump - Premium hosting services at competitive prices!

This article uses material from the WordPress community and the internet.

Article from Teodora Boyanova

Author has no description yet.

Social Networks:
More articles

Subscribe to Our Newsletter

With your subscription, you get more up-to-date news and our special promo offers

Subscribe to Our Newsletter