Affiliate Disclosure: Some links on this page are affiliate links. If you purchase through our links, we may earn a commission at no extra cost to you.
Last updated: December 5, 2026 · Reading time: about 11 minutes
WordPress maximum execution time exceeded is a PHP fatal error that appears when a script runs longer than the max_execution_time limit, which is 30 seconds on most hosts. Fix it by raising max_execution_time in php.ini or .user.ini, giving the specific task more time with set_time_limit, and removing the slow step that made the task take so long.

Key takeaways
- The error is PHP stopping a script, not WordPress crashing. The script is killed mid-task, so half-finished work is normal.
- Raising the limit helps a legitimate long job, such as a backup or a big import. It does not fix an infinite loop or a slow external request.
- On shared hosting the limit is often locked to 30 seconds, and .user.ini or the host panel is the only way to change it.
- Command-line PHP usually has no time limit, so WP-CLI and system cron are good ways around it.
- Look at the task that timed out before you change any number. The same error has several very different causes.

What does maximum execution time exceeded mean?
PHP counts the seconds a script spends running and kills it when the count passes max_execution_time. The full message reads Fatal error: Maximum execution time of 30 seconds exceeded in /path/to/file.php on line N. The default is 30 seconds for web requests, and the PHP manual documents it as a per-script limit that the host can change.
Because the script is stopped in the middle, you see the side effects rather than a clean error page: an import stuck at 78%, a backup file that never appears, a plugin update that leaves the site half updated, or a white screen. If the front end also breaks afterwards, our guide to the WordPress white screen of death is the next step.
WordPress maximum execution time exceeded: find the slow task first
Identify the action that times out before you touch the PHP settings, because a timeout during an import and a timeout on every page load need different fixes.
- Note when it happens. Only during a backup, an import or a plugin update, or on every page? A constant timeout is a code or hosting problem, not a limit problem.
- Turn on the debug log. In wp-config.php set WP_DEBUG and WP_DEBUG_LOG to true, then read wp-content/debug.log. The last line before the fatal error names the file and the function that ran too long.
- Install Query Monitor temporarily. It shows which plugin, query or HTTP request took the time on a slow page.
- Check the error timing. If the site dies at almost exactly 30 seconds every time, it is the limit. If it dies at random times, suspect memory or an external service.
- Reproduce on a staging copy. Run the same import or backup there so you can change limits without risking the live site.


How to raise max_execution_time in PHP
Set max_execution_time to 300 or 600 in the php.ini that your site actually loads, or in a .user.ini file in the WordPress root on PHP-FPM, then reload PHP.
- php.ini: change the line to max_execution_time = 300 and restart PHP-FPM or Apache. Confirm the loaded file under Tools → Site Health → Info → Server.
- .user.ini: a file in the WordPress root with max_execution_time = 300 works on many PHP-FPM hosts and needs no restart. It takes a few minutes to apply.
- Host panel: most shared hosts expose the value under PHP options or MultiPHP INI Editor. This is the only route when php.ini is read-only.
- Do not use php_value in .htaccess unless PHP runs as an Apache module. With PHP-FPM it triggers a 500 error.
Ask your host before you set a very high number. Some hosts cap the value, and some enforce a separate hard timeout at the web server that will cut the request anyway.

How to give one task more time without changing the server
Call set_time_limit at the start of the specific job, or run the job from the command line where PHP usually has no time limit. Both avoid loosening the limit for every visitor.
- set_time_limit(300) inside a small must-use plugin, or in the code that starts the long job. Many backup and import plugins already do this and still fail when the host blocks it with a hard limit.
- WP-CLI: wp db export, wp plugin update –all and wp media regenerate run under the CLI php.ini, which normally has no time limit. This is the most reliable workaround.
- System cron instead of WP-Cron: add a real cron job that calls wp-cron.php with the CLI binary. Traffic-triggered cron runs inside a web request and inherits its timeout.
- Split the job: import in batches of a few hundred rows, or regenerate thumbnails in smaller groups. Short tasks never reach the limit.
Why raising the limit is not always the fix
A script that times out is sometimes waiting on something that will never answer, and a longer limit just makes the page hang longer. Check these before you set 600 seconds and forget it.
- A slow external request. A plugin calling a dead API can block for 30 seconds or more. Set a short timeout on remote requests, and remove the plugin if the service is gone.
- An infinite loop or a runaway query. The debug log shows the same file line every time. Raise nothing; fix the code or replace the plugin.
- Not enough memory. A job that runs out of memory can also die near the limit. Our guide to WordPress memory exhausted error explains the difference.
- A proxy timeout. When the browser shows 504 Gateway Timeout instead of the PHP message, the limit that fired is at the server or CDN, not in PHP. See WordPress 504 gateway timeout.
Which WordPress tasks usually hit the limit?
Some jobs are simply long. These are the ones that time out most often on a 30 second limit:
- Database backups and migrations, especially on sites with large postmeta tables.
- Demo content imports and CSV or XML imports with thousands of rows.
- Bulk plugin and theme updates from the dashboard.
- Image thumbnail regeneration after changing a theme’s image sizes.
- WooCommerce order exports and report generation.
- WP-Cron jobs that run several heavy tasks in one request.
- Sitemap generation and cache preloading on large sites.
If your site is slow in general rather than failing at one task, work through how to speed up a WordPress site first. A faster site finishes the same job well inside the limit.

How to tell a timeout from a memory error or a gateway error
The messages are different, and so are the fixes:
- Maximum execution time exceeded: PHP time limit. Raise max_execution_time or shorten the task.
- Allowed memory size exhausted: PHP memory limit. Raise memory_limit or reduce what the script loads.
- 504 Gateway Timeout: the web server or proxy gave up waiting for PHP. Raise the proxy timeout as well as PHP’s.
- 413 Request Entity Too Large: the request body is too big, which is a size limit. Our guide to WordPress 413 request entity too large covers it.

Frequently asked questions
What is a safe value for max_execution_time?
30 seconds is fine for normal page loads. Use 300 for backups, imports and updates, and only go higher for a known long job. Keep normal pages short so a broken plugin cannot hold a worker for minutes.
Why does the error come back after I changed php.ini?
PHP is loading a different file, or PHP-FPM was not restarted. Check the loaded configuration path in Site Health, and confirm with a phpinfo page.
Can I change max_execution_time in wp-config.php?
Not with a constant. You can call set_time_limit from a must-use plugin or theme code, but a host that enforces a hard limit will still stop the script.
Does the error damage my site?
The script stops where it was, so the risk is partial work: a half-written database, a half-copied file, a plugin left in a broken state. Take a backup before you retry a long task.
Why does the backup plugin fail even with a 600 second limit?
Either the host enforces a lower hard limit, or the backup needs more memory, or the plugin is waiting on a slow disk. Run the backup from WP-CLI or from the host’s own backup tool.
Does a timeout affect SEO?
If it only happens during admin tasks, no. If pages time out for visitors or Googlebot, the URL starts returning 5xx and rankings suffer, so fix it quickly.
Is max_input_time the same thing?
No. max_input_time limits how long PHP spends parsing the request, and it matters for large uploads. A big upload can fail on input time even when execution time is generous.
Sources and further reading
- PHP manual: runtime configuration, including max_execution_time.
- PHP manual: core php.ini directives.
- WordPress developer handbook: Debugging in WordPress.
Summary
Maximum execution time exceeded is PHP cutting off a script that ran past max_execution_time. Find the task that times out, raise the limit where your site actually reads it, and give long jobs more room with set_time_limit or WP-CLI. If the script is stuck rather than slow, fix the cause instead of the number. Keep a recent backup before retrying a job that died halfway, as described in how to back up a WordPress site.