“Maximum Execution Time Exceeded” Error in WordPress means that some PHP Script runs for longer than the server would like. Rather than continue executing, PHP will kill off the process upon reaching the execution time limit.
This error can be encountered during file upload, WordPress or Plugin update, content import, back-ups, heavy data handling or any other process demanding additional resources. This problem may occur as well when a Plugin or Theme needs more execution time than your current hosting environment can handle.
This guide will teach you how to deal with this WordPress issue by boosting your PHP execution limit, finding heavy plugins or processes, and knowing when it is time for you to upgrade your WordPress hosting or switch to a VPS.
Table of Contents
Meaning of Maximum Execution Time Exceeded in WordPress?
WordPress works on PHP, which has a restriction on how much time one script will run for.
The max_execution_time setting governs this in PHP. In case the limit is set at 30 seconds, then a PHP script that will exceed its runtime will get terminated.
The problem may arise when doing the following tasks:
- Install or update plugins
- Update WordPress
- Importing big files
- Image processing
- Backups restore
- Website migration
- Database operations
- Heavy resource plugin functions
An increase in execution time solves the problem in case the job is legitimate and just requires some extra time for processing. But repeated increases in the limit without finding the root cause may mask the issue of a plugin, configuration, or resource.
Why Does the WordPress Script Time Out?
Here are a few reasons why:
- There is a low PHP execution time limit
- A particular plug-in has a time-consuming process
- The theme has poor-quality code
- An import or migration process is going on
- There is a time-consuming backup or restoration process
- The website doesn’t have enough server resources
- Database processes are time-consuming
- There are hosting limitations to increase the PHP limit
Before you make the change to the PHP configuration, think about what you were doing when the error came up. This will allow you to figure out if you require an increased execution limit or not.
Solutions to WordPress “Maximum Execution Time Exceeded” Errors
1. Determine Your Current PHP Execution Time Limit
The initial step should be identifying how much time your server is allowing in executing PHP code.
This information can be found in WordPress from:
| Tools→Site Health→Info→Server |
PHP settings will appear among other server details, including execution time limit when it is shown. This can also be done via the control panel of your web hosting service provider.
In case your website is restricted by a relatively small time of execution and you need to execute an actual function, increasing the time limit will fix the problem.
2. Increase the PHP Execution Time via wp-config.php
Based on the nature of your web host, it may be possible to increase the PHP execution time via WordPress’s wp-config.php file.
One of the most common options available is:
| set_time_limit(300); |
Nonetheless, this approach will depend on the settings of the server’s PHP and web host. Some servers may not allow such actions such as
| set_time_limit() |
In that case, you should ensure that this is set properly by your host provider before using this technique. Do not set a limit too high as well. Scripts taking much time to execute may end up using the server’s processing power for too long.
3. Increase the Limit With .htaccess
In the case of Apache hosting environment, it is possible that the PHP configuration can be done using the .htaccess file.
In some cases, the following line might work:
| php_value max_execution_time 300 |
But this might not always work under all server configurations. When PHP is running on a setting where this directive cannot be used, then adding it to .htaccess will cause an error. Before you edit .htaccess, ensure that you have created a backup of the file.
4. Modify PHP Limits in cPanel
Your hosting company could provide cPanel access, which means that there would be no need for manual PHP modification through the WordPress installation folder.
Here, depending on how cPanel is set up, find:
| cPanel → Software → MultiPHP INI Editor |
Choose your domain, and find:
| max_execution_time |
Here, you will be able to modify the setting according to the available limits in your hosting plan.
For example:
| max_execution_time = 300 |
The actual options that are available would be determined by your hosting company and PHP setup. When cPanel doesn’t let you set it, then the hosting provider might have put up an obligation on the server side.
And that’s the first reason why it’s so important to know about the restrictions of shared hosting.
5. Inspect Plugins and Themes
Raising the execution limit might help fix the current problem, but it will not fix the problem of why the script is running so slowly.
In case you received the error after you have installed or upgraded your plugin, first check the plugin.
It could be doing one of the following:
- Database queries
- Image processing
- External API calls
- Imports
- Automatic backup operations
- WooCommerce operations
Deactivate the plug-in temporarily to see whether the problem is solved. If the problem resolves itself, see if there is an update, setting, or troubleshooting method available for the function being performed by the plugin.
There are also other ways to diagnose the issue with your plugin and configuration settings as described in HarmonWeb’s troubleshooting guide for WordPress errors.
6. Test Your Hosting Resources
The maximum execution time error can sometimes simply indicate that you lack adequate resources at your hosting provider.
When your site runs out of CPU power, RAM, PHP workers, or any other available resources, then the processes may run slower.
This is particularly pertinent to sites that have any of the following:
- Traffic
- WooCommerce
- Large databases
- Plugins
- Automatic backups
- Membership system
- Large media library
- Regular imports/exports
In shared hosting, your hosting is done according to the set resource limits. If your website is considerably bigger, the resources offered at the existing plan level might not be enough anymore.
There is a useful guide to shared server resources by HarmonWeb about resource limits. This is how to check your resources on cPanel:
- Login to your client area on the Harmonweb website and click on your active cPanel service.
- Find the IO account resource section on the dashboard.
- Check statistics such as physical memory, disk space usage, entry process, and bandwidth usage.
7. Consider VPS Hosting for Resource-Hungry Websites
There comes a time for some websites where additional control is required beyond shared or normal WordPress hosting.
A VPS will afford you an isolated server environment along with more server/PHP configuration control. This can be useful if you conduct regular resource-consuming activities.
However, the use of VPS is not always the most appropriate option for any WordPress website. It requires some degree of technical expertise and experience with server management compared to shared and managed WordPress hosting.
When your website’s needs are known and you have more control over PHP, server processes, or any other configurations, you should consider using VPS hosting.
8. Check If You Have Control Over Your Hosting Limitation
If your attempt to set the max_execution_time has failed to make any difference, the limitation on the value could be placed by your hosting provider. It is a typical case with managed or shared hosting when a customer cannot alter some settings of PHP and servers.
Here, you should contact your hosting company and find out if there is an opportunity to increase the limitation on PHP execution. Read more on the best hosting companies in Nigeria.
How to Avoid PHP Maximum Execution Time Errors
After fixing the issue, here are some measures to ensure that it doesn’t happen again:
- Ensure your WordPress software, themes, and plugins are up-to-date.
- Don’t use any resource-consuming plugins.
- Perform large imports in small batches.
- Keep an eye on resource consumption by your hosting.
- Do regular backups of your site.
- Remove plugins that are unused.
- Improve your database
In case the same procedure exceeds the time out continuously, don’t increase the timeout any further. Find out what causes such a long process time.
Conclusion
In most cases, the “Maximum Execution Time Exceeded” error in WordPress is triggered by a process that lasts beyond the specified execution limit by the server. It can be fixed easily by extending max_execution_time, changing the value via cPanel, finding a troublesome plugin, or executing a task in small parts.
In case the issue persists, there might be need for your website to have more resources and control at the server level.
Looking for better WordPress hosting?
HarmonWeb offers WordPress, shared and VPS hosting services for varying website traffic. In case your WordPress site is always executing demanding processes, having proper resources on the hosting platform could solve this problem.


