How to Fix Fatal Error: Maximum Execution Time Exceeded in WordPress
Do you see “Fatal error: Maximum execution time of 30 seconds exceeded” on your screen when you try to update a WordPress plug-in or theme?
Usually, this problem occurs when a PHP code 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 misuse of server resources.
In this article we show you how to correct the fatal error: maximum execution time exceeded in WordPress.
Why does the maximum execution time exceed?
WordPress is mainly coded in the PHP programming language. To protect web servers against abuse, a time limit has been set for how long a PHP script can run.
The actual time limit varies between hosting companies, but usually, the maximum execution time is set between 30 – 60 seconds because that is usually enough to run a good PHP script.
When a script reaches the maximum execution time, this results in a maximum error in the execution time exceeded.
Solution Maximum execution time exceeded the r
Although the Maximum execution time exceeded error is called a “fatal error”.
Depending on where and when the error is triggered, WordPress can display the following error message to your website visitors.
This is part of the fatal error protection feature that is added in WordPress 5.2. You can also receive an e-mail stating which plug-in (if a plug-in caused the error) caused the problem.
The e-mail also contains a special link, with which you can log in to WordPress with ‘Recovery mode’.
Once there you can easily deactivate or remove the plug-in that is causing the error.
However, if you do not want to deactivate a plug-in, you can correct the underlying cause that caused the error.
To fix the error, you must manually edit your .htaccess file and add a simple line of code.
Your .htaccess file is located in the same folder as your / wp-content / and / wp-admin / folders.
For example, if you use FileZilla as your FTP client, you can find it in the “Remote Site” section in the right-hand column.
Once you have found the .htaccess file, right click and open the ‘View/edit’ option. This opens the file in a text editor.
you must then add this line at the bottom of your .htaccess file:
php_value max_execution_time 300
If you use Notepad as your text editor, you can see here what it can look like.
Save your file after you are done.
With this code, the value for the maximum execution time is simply set to 300 seconds (5 minutes). You can now visit your website to see if the error has been resolved.
If you still get the error, try increasing the value to 600.
Another method to exceed the maximum execution time error in WordPress is by adjusting your php.ini file.
The php.ini file is a configuration file that defines settings for PHP on your server. On many WordPress hosting platforms, you may not see this in your WordPress folder.
In that case, you can create a new php.ini file in your WordPress root. Then edit the php.ini file and add the following line.
max_execution_time = 60
Don’t forget to save your changes and upload them to the server. You can now visit your website and see if the error has disappeared.
In most cases, increasing the maximum execution time using one of these two methods will resolve the error. If this is not the case, you should contact your WordPress hosting provider for assistance.