
Seeing a Fatal Error: Maximum execution time exceeded message on your WordPress site can be alarming, especially when it appears out of nowhere during an update, import, or backup. The good news is that the maximum execution time exceeded fix is usually a simple configuration change that takes only a few minutes. This error simply means a PHP script on your site needed more time to finish than your server allows, and this guide walks you through five proven ways to raise that limit and stop the timeout for good. If you manage WordPress sites regularly, our collection of free SEO and web tools can help you monitor and maintain them more efficiently.
What Causes Maximum Execution Time Exceeded
Every PHP script that runs on your server has a built-in time limit, usually 30 seconds by default. This is a safety mechanism that stops runaway scripts from hanging the server. When a legitimate task — like importing products, restoring a backup, or updating a large plugin — takes longer than that limit, PHP kills it and throws the “maximum execution time exceeded” fatal error. Here are the most common causes:
- Heavy or poorly coded plugins: a single resource-hungry plugin can make every page request take several seconds, pushing long tasks past the limit.
- Large imports and backups: migrating thousands of posts, products, or media files in one go is the classic trigger for this error.
- Image processing: bulk-regenerating thumbnails or optimizing hundreds of images can easily exceed 30 seconds.
- Underpowered shared hosting: on crowded shared servers, slow CPU and disk I/O make normal tasks take far longer than they should.
- Memory pressure: time and memory limits fail together — when PHP also runs low on memory, scripts slow to a crawl before timing out. Check the KamiWeb blog for more WordPress performance guides.
- Overloaded WP-Cron: a backlog of scheduled events (scheduled posts, update checks) can pile up and choke long-running processes.
How to Fix Maximum Execution Time Exceeded
Before changing anything, confirm the timeout is really the problem: check your PHP error log (in your hosting control panel) for a line mentioning “maximum execution time exceeded”. Once confirmed, work through these five fixes in order — most people solve it with the first two.

- Raise the limit via wp-config.php. Open
wp-config.phpin your WordPress root directory (via File Manager or FTP) and add this line just above/* That's all, stop editing! Happy blogging. */:set_time_limit(300);. This gives PHP 300 seconds (5 minutes) instead of 30. Save and re-test the task that failed. - Edit .htaccess (Apache / LiteSpeed servers). If the wp-config change is ignored by your host, open the
.htaccessfile in yourpublic_htmlfolder and add this line at the bottom:php_value max_execution_time 300. Save the file. Note: this only works on Apache or LiteSpeed with PHP overrides enabled — it has no effect on Nginx. - Change it in php.ini or your hosting panel. Create or edit a
php.inifile in your WordPress root withmax_execution_time = 300, or use your host’s PHP settings page (in cPanel: Software → Select PHP Version → Options). Control-panel changes are the cleanest method when available, and you can raise the value to 120–180 if 300 doesn’t hold. - Find the slow plugin or theme. If the error returns even with a generous limit, something is genuinely slow. Deactivate all plugins, test the task, then reactivate them one by one until the culprit reappears. Replace or optimize anything that is needlessly heavy — a bigger limit can’t fix inefficient code.
- Move big jobs off the browser. Large imports, exports, and backups are far more reliable when run through WP-CLI (
wp import,wp db export) or a server cron job instead of a browser request. They bypass web-server timeouts entirely and won’t stall if your connection drops. - Contact your host or upgrade the plan. If you’ve raised the limit to 300 seconds and still hit the wall, the real problem is a starved server, not a small number. Ask your host to confirm the effective
max_execution_timevalue; if the server simply can’t keep up, moving to a plan with more CPU and memory is the honest fix.
Conclusion
The “Maximum execution time exceeded” error looks scary, but the maximum execution time exceeded fix is straightforward: raise PHP’s time limit via wp-config.php, .htaccess, php.ini, or your hosting panel, find and remove any slow plugins, and move heavy jobs to WP-CLI. Start with set_time_limit(300), and only consider a hosting upgrade if generous limits still don’t help. For more WordPress troubleshooting and free utilities, explore everything KamiWeb offers.
