Skip to content

How to fix fatal error: Maximum execution time exceeded in WordPress?

WordPress, as one of the most popular website creation tools, can sometimes encounter all sorts of problems. The “Maximum execution time exceeded” error is one of them. This error occurs when the script takes longer than allowed by the server configuration. In this article we will present some solutions to this problem.

1. Modification of the .htaccess file

The simplest and most frequently used solution is to modify the .htaccess file. This file is located in the root directory of your WordPress installation and is responsible for various server settings. To increase the maximum execution time, simply add the following code:

php_value max_execution_time 300

A value of 300 means 300 seconds, which is equivalent to 5 minutes. You can adjust this value to suit your needs. Remember to always back up your .htaccess file before making any changes.

2. Modification of the wp-config.php file

Another way to increase the maximum execution time is to modify the wp-config.php file, which is also located in the root directory of your WordPress installation. In this file, add the following code:

set_time_limit(300);

As with the .htaccess file, 300 means 300 seconds. Always create a backup of the wp-config.php file before making any changes.

3. Using the WP Maximum Execution Time Exceeded plugin

If you are not comfortable modifying configuration files, you can use the WP Maximum Execution Time Exceeded plugin. This plugin allows you to increase the maximum execution time without having to modify files. After installing and activating the plugin, the execution time exceeded will be automatically increased.

4. Contact your hosting provider

If the above methods did not help, you should contact your hosting provider. Some hosting companies have strict limits on maximum execution time and the only way to change them is to ask customer support.

Remember that increasing the maximum execution time may impact server performance, so always try to optimize your pages so that your scripts run as quickly as possible.

Check out the offer of 1500+ Premium WordPress plugins and themes!