Updating your plugins and themes regularly is necessary to keep your site running at full capacity. However, the fatal WordPress error ‘maximum execution time exceeded’ can prevent updates and leave you feeling concerned about your website’s performance. Fortunately, you can use a few methods to remove the error or increase the maximum execution time: You can uninstall the problem software, use a plugin, or edit your site’s code directly to solve the issue in no time.
In the article
What is 'WordPress Maximum Execution Time Exceeded' error?
The maximum execution time error is one of the most common WordPress errors. It can appear when you are trying to update your WordPress plugins or themes. It alerts you that your site was unable to perform the updates you requested. This error happens because of the PHP scripts on your website. PHP is a scripting language that is the foundation of WordPress sites. It is made up of code that controls how the website functions and shows different elements to users.
As such, the maximum execution error directly relates to how long a PHP script takes to run. PHP scripts have a maximum execution time to keep your site functional and secure. For example, if there were no limit, a hacker or malicious software could use neverending scripts to dismantle your website’s server and make your data vulnerable. Furthermore, PHP scripts running for a long time can divert resources from your server.
Plugins are more likely to trigger the error because they come with a lot of code from external sources. WordPress is an open-source platform, so any developer can design and upload plugins for it. If you install content from lesser-known developers, it may come with flawed code and cause issues in your site’s PHP scripts. Themes and general WordPress updates can also cause the problem. However, this is less common.
What is the standard and default maximum execution time?
Most hosting providers have a standard maximum exection time of 30 seconds while the default WordPress maximum exection time is 40 seconds. This is typically enough time for most PHP scripts to run successfully. However, large websites with multiple resources may need slightly longer maximum execution times. Otherwise, they may not be able to complete their processes before the clock runs out. Additionally, some developers may use very long execution times of more than 300 seconds. However, this is not recommended for most websites for security reasons.
How to figure out if the error has occurred
It is usually obvious that the maximum execution time error has happened because you will see a notification in your WordPress dashboard. But it may not always have the same wording. For example, it may read as ‘fatal error’ or ‘critical error’. The notification also might not reference the maximum execution time. However, all of the warnings share similar components that can alert you to the source of the problem.
Front-end users may also be able to see the error. If they visit the site when the update process has failed, they might see a message telling them that your website is experiencing technical difficulties. However, this error message doesn’t only appear because your maximum execution time has been exceeded. As such, you’ll want to check and see if it shows up in your WordPress dashboard as well.
Finally, you may receive an email from WordPress alerting you that the maximum execution time has been exceeded. This happens because of the PHP error protection that automatically notifies you when your site has problems with its themes or plugins. As such, you will almost immediately know that there is an issue with your updates.
How to fix the maximum execution time exceeded error
There are a few different methods you can use to eliminate the max execution time error or increase your site’s maximum execution time. You may first want to consider your comfort level with directly editing your site’s files and adding new code. If this method sounds beyond your technical abilities, there are fortunately other options available.
1. Uninstall the problem software
One of the simplest ways to fix the maximum execution time error is to uninstall the software causing the issue. One of your plugins or your site’s theme is likely the culprit, so you can start there. Use this method if you have a hunch that a specific application is causing the problem. For example, you may have recently added a new plugin or updated an old one.
If the error locks you out of your site, you can access the dashboard via ‘Recovery Mode’. If you received an email from WordPress about the failed updates, it usually includes a link to ‘Recovery Mode’ and may even tell you which plugin caused the problem. Then, navigate to Plugins > Installed Plugins and click on ‘Deactivate’ underneath the relevant item. Click on ‘Delete’ to remove it.
You can also use cPanel or FTP/SFTP to remove the plugin, navigate to File Manager > public_html > wp-content > plugins. If you don’t know what is causing the maximum execution time exceeded error, you can deactivate all of your plugins and reactivate them one by one. Refresh each time and see if you can find the one that triggered the problem.
2. Increase the maximum execution time
When a certain operation reaches the set execution time limit, the system will return the ‘Maximum execution time of X seconds exceeded’ fatal error. There are several ways to increase the maximum execution time, and they all involve using cPanel or FTP/SFTP.
3. Contact your hosting provider
If you would prefer not to change your site’s files yourself, you have another option. You can contact your hosting provider directly, and they can increase the maximum execution time on your behalf. This method could be an excellent option if you’re short on time or have limited technical skills.
The maximum execution time exceeded error in WordPress can get in the way of updating your plugins and themes. Although it can be frustrating when it happens, you can use the methods mentioned above to solve the problem quickly.