Fix Fatal Error: Maximum execution time of 30 seconds exceeded

While updating themes or installing plugins you can get a fatal error known as Maximum Execution Time Exceeded error. This error blocks you from updating or installing any new themes and plugin and interrupts you from performing any other operations in your website. So in this post, I will show steps to fix fatal Error Maximum Execution Time exceeded in WordPress.

Fix fatal Error Maximum Execution Time exceeded in WordPress

Why Maximum Execution Time exceeded occur in WordPress?

This error is the result of a security precaution taken by WordPress. By default, WordPress has set a time limit for running PHP script. When the execution of PHP script exceeds the time limit, this gives you the Maximum Execution Time Exceeded Error.

Fix Fatal Error Maximum Execution Time exceeded in WordPress

The fix is to expand the default time limit for execution of a process. This error occurs when updating a theme, installing plugin, downloading an application or performing some other operation in website. By default maximum execution time of PHP system is 30 seconds. The recommended fix is to manually increase the execution time. There are 3 files available in WordPress from where you can increase execution time. The three files are .htaccess, wp-config.php, and php.ini files. There is no need to make changes in all three files as action in any one of these files will do the job. Before performing any action keep back up of files you are about to edit. Let us see how to make changes in all three files:

Using htaccess file

Adding a single line of code in the htaccess file can help you get rid of Maximum Execution Time exceeded Error. Follow these steps to use htaccess file for removing error.

  1. Connect to your website using FTP or cPanel.
  2. Find htaccess file which is located in any folder as /wp-content/ or /wp-admin/
  3. Add this line in your htaccess file.
Php_value max_execuion_time 300
  1. Finally save the file.

The above code will set value for maximum execution time to 300 seconds or 5 minutes. If you still get error increase the value of execution time to something higher.

By wp-config.php changes

This wp-config file can be easily found in the root location of your WordPress installation. It is a very important file so be very careful while editing this file. You can add the following code in the file to increase the execution time.

Set_time_limit(300)

The above code sets the value to 300 seconds.

Php.ini file

If you already have a php.ini file in your installation folder, just open the file and add below mentioned code. If you don’t have php.ini file you can create it yourself. Just create a text file and name it php.ini and add the code given below.

Max_execution_time 300;

Save the changes and upload it in the root folder of WordPress installation files

Also Read:   Adding Front End Login Feature with Theme My Login Plugin
Using plugin

If you don’t want to mess around the codes or don’t want to explore through files structure then you can use a plugin to do this task. Using plugin is the safest way available for removing this error and this will save you from a lot of troubles. You can use a plugin called WP Maximum Execution Time Exceeded. This is a simple and effective plugin.

Follow these steps to add the plugin to your website

  1. Login to your admin dashboard
  2. Navigate to Plugin > Add New
  3. In the Add Plugins page, find and activate the plugin called WP Maximum Execution Time Exceeded.

Fix fatal Error Maximum Execution Time exceeded in WordPress

The plugin will automatically increase the maximum execution time limit to 300 seconds. This plugin simply uses the .htaccess file to solve the problem. When WP Maximum Execution Time Exceeded is activated after installation, the plugin will automatically write the necessary code to the .htaccess file. To delete the code, simply deactivate the plugin. There is no any administration page.

We hope the article was helpful for you to fix fatal Error maximum execution time exceeded in WordPress.

The following two tabs change content below.
Kantiman Bajracharya

Kantiman Bajracharya

Kantiman Bajracharya is a freelance web developer. He is a computer geek who has a Bachelor’s degree in Computer Engineering. He has earned lots of satisfied customers while working for numerous successful projects. He is also a WordPress theme creator and web article writer. On free time he likes reading philosophy books, traveling and playing chess.

Share This Post