How to Fix Fatal Error: Maximum Execution Time Exceeded in WordPress

shape
shape
shape
shape
shape
shape
shape
shape

Encountering the ‘Fatal error: Maximum execution time of 30 seconds exceeded’ message while attempting to update a WordPress plugin or theme is a common issue. This problem arises when a PHP script within WordPress surpasses the maximum execution time limit imposed by your hosting server. The time limit is essential for preventing the misuse of server resources.

In this article, we will guide you through resolving the fatal error related to the maximum execution time exceeded in WordPress.

Why Does the Maximum Execution Time Exceeded Error Occur?

The ‘Maximum execution time exceeded’ error occurs in WordPress due to the time limit set for PHP scripts, which is the programming language underlying WordPress. This limit is imposed to prevent the misuse of web server resources.

Hosting companies have different configurations for time limits, usually ranging from 30 to 60 seconds. If a PHP script on your WordPress site exceeds this allotted time, it triggers the ‘Maximum execution time exceeded’ error.

How to Resolve the Maximum Execution Time Exceeded Error in WordPress

Despite being labeled a ‘fatal error,’ the maximum execution time exceeded issue is a common WordPress error that is relatively straightforward to fix.

Let’s explore the steps to resolve the maximum execution time exceeded error in WordPress.

Method 1: Utilize WordPress Recovery Mode

When the maximum execution time exceeded error occurs, WordPress may display the ‘This site is experiencing technical difficulties’ error notification on the front end, depending on when and where the error is triggered. This is part of the fatal error protection feature introduced in WordPress 5.2.

If a plugin is responsible for the error, you might also receive an email indicating the problematic plugin.

The email will contain a special link that allows you to log in to WordPress using ‘Recovery mode’.

Once in the recovery mode, you can easily deactivate or delete the plugin causing the error.

Method 2: Edit Your .htaccess File

This solution is recommended for WordPress users who are unable to access their WordPress dashboard. To address the maximum execution time limit error, you’ll need to manually edit your .htaccess file by adding a simple line of code.

Start by connecting to your website using an FTP client or the File Manager app in your cPanel or other web hosting dashboard.

Your .htaccess file is located in the same folder as your /wp-content/ and /wp-admin/ folders. If you can’t find it, refer to our article on locating the .htaccess file.

For instance, if you are using FileZilla as your FTP client, you can find it in the ‘Remote Site’ section in the right-hand column.

Once you locate the .htaccess file, right-click on it and select the ‘View/Edit’ option.

This will open the file in a text editor.

Next, add the following code at the bottom of your .htaccess file:

				
					php_value max_execution_time 300
				
			

If you are using Notepad as your text editor, the process may look like this:

Once you have added the code, save the file.

Adding Code to .htaccess File in WordPress
This code essentially sets the value for maximum execution time to 300 seconds (5 minutes). After saving the file, check your website to see if the error message persists.

If the error persists, consider increasing the value to 600.

If you found this method helpful, explore more useful .htaccess tricks for WordPress.

Method 3: Modify the php.ini File

Another approach to resolve the maximum execution time exceeded error in WordPress is by adjusting your php.ini file.

The php.ini file serves as a configuration file defining settings for PHP on your server. On several WordPress hosting platforms, this file may not be visible in your root folder.

In such cases, you can create a new php.ini file within your WordPress root folder using FTP or the File Manager app.

Subsequently, edit the php.ini file and insert the following line:

				
					max_execution_time = 60
				
			

Don’t forget to save the file and upload your changes back to the server. You can now visit your website to see if the error has been resolved.

In the majority of cases, increasing the maximum execution time using these two methods will rectify the error. However, if it doesn’t, then you should contact your WordPress hosting provider for assistance.

Leave a Reply

Your email address will not be published. Required fields are marked *