The error “Maximum execution time of 30 seconds exceeded” means a PHP task took longer than the server allows and got cut off. It typically strikes during imports, backups, updates or heavy plugin operations. The fix is to give PHP more time to finish. Here’s how.
What the limit does
The max_execution_time setting caps how long any single PHP script may run, measured in seconds. It exists to stop a runaway script from hogging the server forever. The default is often 30 seconds, which is fine for normal page loads but too short for big operations like importing a large file or updating a complex plugin.
Method 1: MultiPHP INI Editor (recommended)
The cleanest fix on cPanel hosting:
- Open MultiPHP INI Editor in cPanel.
- Select your domain.
- Set
max_execution_timeto300(five minutes). - Apply.
Five minutes is plenty for most imports and updates without leaving scripts able to run indefinitely.
Method 2: wp-config.php
You can also nudge the limit from WordPress by adding this near the top of wp-config.php:
set_time_limit(300);
This works if the server permits scripts to override the limit, though the INI Editor method is more dependable.
Method 3: .htaccess
As a fallback, add this to your site root’s .htaccess:
php_value max_execution_time 300
If it triggers a 500 error, your server doesn’t allow this directive in .htaccess — remove it and use the INI Editor.
Address the underlying task
Raising the limit is the right fix for legitimate long tasks like a big import. But if a normal page load is timing out, something is wrong — a plugin stuck in a loop, an inefficient query, or a resource shortage. In that case, don’t just raise the limit; find out why a routine operation takes so long. Debug mode and a query monitor help here.
For very large operations
Some jobs — migrating a huge site, importing tens of thousands of records — are better done in batches or from the command line than by pushing the timeout ever higher. If you’re wrestling with a giant import, tell us what you’re doing and we can run it server-side without timeout worries.
For most people, bumping the limit to 300 in the INI Editor solves this instantly.