How to Fix Fatal Error: Maximum Execution Time Exceeded in WordPress
-
by cobra_admin
- 52
Are you seeing ‘Fatal error: Maximum execution time of 30 seconds exceeded’ on your screen when trying to update a WordPress plugin or theme?
Typically this problem occurs when PHP script in WordPress takes a long time to run and reaches the maximum time limit set by your WordPress hosting server. The time limit is important because it helps prevent the abuse of server resources.
In this article, we will show you how to fix the fatal error: maximum execution time exceeded in WordPress.

Why Does the Maximum Execution Time Exceeded Error Happen?
WordPress is coded mainly in the PHP programming language. To protect web servers from abuse, there is a time limit set for how long a PHP script can run.
The actual time limit varies across hosting companies. However, most of the time, the maximum execution time is 30 – 60 seconds because that’s usually enough for a good PHP script to run.
When a script reaches the maximum execution time limit, it results in the maximum execution time exceeded error on your WordPress website.

How to Fix the Maximum Execution Time Exceeded Error in WordPress
Although the maximum execution time exceeded error is called a ‘fatal error,’ it is one of the most common WordPress errors, and you can easily fix it.
That being said, let’s look at how to fix the maximum execution time exceeded error in WordPress. You can use the links below to jump to the different troubleshooting methods.
Use WordPress Recovery Mode
Depending on when and where the error is triggered, WordPress may show the ‘This site is experiencing technical difficulties’ error message to your website visitors.

This is part of the fatal error protection feature added in WordPress 5.2.
You may also receive an email that will tell you which plugin (if a plugin triggered the error) caused the issue.

The email will also include a special link.
This will allow you to log in to WordPress using ‘Recovery mode’.

Once there, you can simply deactivate or delete the plugin causing the error.
For more details, please see our guide on how to use WordPress recovery mode.
Edit Your .htaccess File
However, if you don’t want to deactivate a plugin, then you can fix the underlying cause that triggered the error.
To fix the error, you will need to manually edit your .htaccess file and add a simple line of code.
Simply connect to your website using an FTP client or the File Manager app in your hosting dashboard.
Your .htaccess file is in the same folder as your /wp-content/ and /wp-admin/ folders. If you can’t find it, then see our article on why you can’t find the .htaccess file and how to find it.
For example, if you are using FileZilla as your FTP client, then you can find it in the ‘Remote Site’ section in the right-hand column.

Once you find the .htaccess file, simply right-click it and select the ‘View/Edit’ option.
This will open the file within a text editor.

Next, you need to add this line at the bottom of your .htaccess file:
| 1 | php_value max_execution_time 300 |
Hosted with ❤️ by WPCode
If you are using Notepad as your text editor, here is how it may look.

Once that is done, go ahead and save the file.
This code simply sets the value for maximum execution time to 300 seconds (5 minutes). You can now visit your website to see if the error message is gone.
If you still get the error, then try increasing the value to 600.
If you found this method helpful, then check out the most useful .htaccess tricks for WordPress.
Modify the php.ini File
Another method to fix the maximum execution time exceeded error in WordPress is by modifying your php.ini file.
The php.ini file is a configuration file that defines the settings for PHP on your server. On many WordPress hosting platforms, you may not see it inside your root folder.
In that case, you can create a new php.ini file inside your WordPress root folder using FTP or the File Manager app.
After that, simply edit the php.ini file and add the following line:
| 1 | max_execution_time = 60 |
Hosted with ❤️ by WPCode
Don’t forget to save the file and upload your changes back to the server. You can now visit your website and to see if the error has gone.
In most cases, increasing the maximum execution time using these two methods will resolve the error. However, if it doesn’t, then you need to contact your WordPress hosting provider for assistance.
We hope this article helped you fix the fatal error: maximum execution time exceeded in WordPress. You may also want to see our guide on how to fix the error establishing a database connection in WordPress and check out our top picks for the best WordPress managed hosting providers.
Are you seeing ‘Fatal error: Maximum execution time of 30 seconds exceeded’ on your screen when trying to update a WordPress plugin or theme? Typically this problem occurs when PHP script in WordPress takes a long time to run and reaches the maximum time limit set by your WordPress hosting server. The…
Are you seeing ‘Fatal error: Maximum execution time of 30 seconds exceeded’ on your screen when trying to update a WordPress plugin or theme? Typically this problem occurs when PHP script in WordPress takes a long time to run and reaches the maximum time limit set by your WordPress hosting server. The…