Troubleshooting · Troubleshooting
How to Fix "Maximum Execution Time Exceeded" in WordPress
Short answer
Raise the PHP time limit to 300 seconds in wp-config.php, .htaccess, or php.ini, then repeat the action that failed. If the error returns, find the slow plugin or theme by deactivating plugins one by one. If your host blocks the change, ask the host to raise the limit for you.
Key takeaways
- PHP stops a script when it runs past the max_execution_time limit, which defaults to 30 seconds for web requests as of November 2026.
- The error often appears during plugin, theme, or WordPress core updates, imports, and backups.
- Adding set_time_limit(300); to wp-config.php gives WordPress scripts 300 seconds to finish.
- A plugin or theme that keeps timing out should be replaced or fixed, not given a higher limit forever.
- Check Tools > Site Health > Info > Server to see the PHP time limit on your site.
What does “Maximum Execution Time Exceeded” mean?
PHP stopped a script because it ran past the time limit set on your server.
The full message often reads “Fatal error: Maximum execution time of 30 seconds exceeded” and names a file and line number. That number is the limit in seconds, so it can read 30, 60, or another value.
PHP sets the default limit to 30 seconds for web requests, as of November 2026. PHP: Runtime Configuration lists that default and explains that the setting caps how long a script may run before the parser stops it.
Visitors may see “The site is experiencing technical difficulties” instead of the full error. WordPress also sends the site admin an email about a fatal error, with a link to Recovery Mode.
What causes the error in WordPress?
A plugin, theme, update, import, or backup task takes longer than the PHP time limit allows.
Most hosts set the limit between 30 and 60 seconds, and Kinsta reports that range as the usual host setting. A task that needs more time stops at the limit, even if it would have finished a little later.
Common triggers include:
- Installing or updating a plugin, theme, or WordPress core
- Importing a large file or a large set of posts, products, or users
- Running a backup, restore, or migration on a large site
- A plugin that runs a slow loop, a heavy query, or a long remote request
- A low limit on shared hosting, where you cannot change every server setting
A time limit error is not the same as a memory error. A memory error says the script ran out of memory, while this error says it ran out of time. If your message names memory instead, see the guide on fixing the allowed memory size error.
How do you check your current PHP time limit?
Open Tools > Site Health > Info > Server in WordPress and read the “PHP time limit” value.
Go to “Tools” in the left menu, then “Site Health”, then the “Info” tab. Open the “Server” section and look for the PHP time limit, which shows the current value in seconds.
Note the number before you change anything, so you can tell if a fix worked. If it reads 30, a task that needs 45 seconds will fail. If it reads 300, the limit is already high and a slow plugin is more likely.
The error message itself also gives the limit. If it says “Maximum execution time of 60 seconds exceeded”, your limit was 60 seconds at that moment.
How do you fix it in wp-config.php?
Add set_time_limit(300); to wp-config.php, just before the line that says “That is all, stop editing!”
Back up your site first, so you can restore it if an edit goes wrong. The WordPress backup guide shows the steps to take before you edit site files.
Use these steps:
- Connect to your site by FTP or open File Manager in your hosting panel.
- Open
wp-config.phpin the site root folder. - Add
set_time_limit(300);just before the stop-editing line. - Save the file and upload it back to the server.
PHP says set_time_limit() restarts the timeout counter from zero when called. PHP: set_time_limit also says a value of 0 removes the time limit, but do not use 0 on a live site.
This method changes the limit for WordPress scripts only. It does not change the limit for other PHP scripts on the server.
How do you raise the limit in .htaccess?
Add php_value max_execution_time 300 to the .htaccess file in your site root, after backing the file up.
WordPress.org gives a smaller example in its common errors guide: php_value max_execution_time 60. Common WordPress errors lists that line for .htaccess and max_execution_time = 60 for php.ini.
Use these steps:
- Download a copy of
.htaccessfrom your site root folder. - Open
.htaccessfor editing. - Add
php_value max_execution_time 300on its own line. - Save the file and upload it back to the server.
This method works only on Apache or LiteSpeed servers that use php_value lines.
On Nginx or PHP-FPM servers it can cause a 500 error, so remove the line at once if the site breaks.
A 500 error after this edit points to the wrong method, not to WordPress itself, as explained in the guide on fixing the 500 internal server error.
How do you raise the limit in php.ini or .user.ini?
Set max_execution_time = 300 in php.ini, or in a .user.ini file in your site root if your host uses PHP-FPM.
WordPress.org also gives max_execution_time = 60 as the php.ini example. A value of 300 gives long tasks 5 minutes, which Kinsta says should give most scripts enough time.
Use these steps:
- Find
php.inior create.user.iniin the site root folder. - Add or change the line to
max_execution_time = 300. - Save the file.
- Restart PHP or Apache if your host requires it, then check Site Health again.
PHP notes that the command-line default is 0, which means no limit. That does not apply to web requests, where the default stays at 30 seconds as of November 2026.
| Method | File | Line to add | Works best on |
|---|---|---|---|
| wp-config.php | wp-config.php | set_time_limit(300); | Most hosts |
| .htaccess | .htaccess | php_value max_execution_time 300 | Apache or LiteSpeed |
| php.ini | php.ini | max_execution_time = 300 | VPS or dedicated servers |
| .user.ini | .user.ini | max_execution_time = 300 | PHP-FPM hosts |
| Plugin | Dashboard | Install and activate | Users who do not edit files |
A plugin that raises the limit can help if you do not want to edit files. Kinsta notes that the WP Maximum Execution Time Exceeded plugin sets the limit to 300 seconds when activated. Remove the plugin if you later want the old limit back.
How do you find the plugin or theme that causes it?
Deactivate all plugins, test the action, then reactivate plugins one by one until the error returns.
Start with the item you changed most recently. If the error began right after you installed or updated a plugin or theme, that item is the first suspect.
Use these steps:
- Back up your site.
- Deactivate all plugins, or use Recovery Mode from the fatal error email if you cannot reach the dashboard.
- Repeat the action that failed.
- Reactivate one plugin, test again, and repeat until the error returns.
- Switch to a default WordPress theme to test whether the theme is the cause.
WooCommerce docs describe the same one-by-one method for plugin and theme conflicts. How to test for plugin and theme conflicts says to update plugins and themes first, switch to a default theme, then reactivate plugins one by one and test after each one.
If one plugin always triggers the error, replace it, contact its author, or keep it off the site. Raising the limit only hides a slow plugin for a while.
How do you know the fix worked?
Repeat the exact action that failed, and check that the PHP time limit in Site Health shows the new value.
If the update, import, or backup now finishes without the fatal error, the fix worked. Run the same action a second time to be sure, since a one-off success can come from a smaller file or a quieter server.
Check these signs:
- The PHP time limit in Tools > Site Health > Info > Server reads 300, or your chosen value
- The update, import, or backup completes to the end
- No new fatal error email arrives in the admin inbox
- The front of the site loads without a technical difficulties message
If the limit in Site Health did not change, your host ignored that method. Try another method from the table above, or ask your host which file it reads.
When should you contact your host?
Contact your host when you cannot change the limit yourself, when the limit resets, or when the error affects normal pages.
Some shared hosts lock the limit and block edits to .htaccess or php.ini. WordPress.org says to contact your host in that case and ask it to raise the maximum execution time.
Kinsta sets a default limit of 300 seconds on its platform, as of November 2026. A Kinsta site that still times out likely has a slow task, not a low limit.
Ask your host for:
- Your current
max_execution_timevalue and its maximum allowed value - Whether
.htaccess,.user.ini, orphp.iniworks on your plan - The server error log entries for the time the error appeared
If a normal page load times out, the cause may be a different timeout, such as a gateway timeout. The guide on fixing the 504 gateway timeout covers that case.
What mistakes should you avoid?
Do not set the limit to 0, do not raise it for a bad plugin, and do not edit files without a backup.
Avoid these mistakes:
- Setting the limit to 0 or to a very high number, which lets a runaway script tie up the server
- Raising the limit again and again instead of finding the slow plugin or theme
- Adding
php_valuelines on Nginx or PHP-FPM, which can break the site with a 500 error - Editing
.htaccessorwp-config.phpwithout a backup copy - Leaving debug mode on after you finish, which can show errors to visitors
PHP notes that Apache and IIS have their own timeout settings, and both default to 300 seconds. Raising the PHP limit past the web server timeout will not help, so ask your host if a higher PHP value still fails.
If you update PHP after this fix, check the limit again. A PHP version change can reset server settings, so confirm the value in Site Health after any PHP update. The guide on updating the PHP version shows how to change versions without breaking the site.
Frequently asked questions
What is a safe maximum execution time for WordPress?
A value of 300 seconds is safe for most sites, since it gives long updates, imports, and backups 5 minutes to finish. Values of 30 to 60 seconds suit normal page loads, while 300 suits one-off heavy tasks. Do not set the limit to 0, because that removes the limit and lets a runaway script tie up the server.
Will raising the time limit slow down my site?
Raising the limit does not slow normal pages, because fast scripts still finish in a few seconds. It only lets a slow script run longer before PHP stops it. If a plugin needs 300 seconds on every page load, that plugin is the problem, and you should replace it or ask its author for a fix.
Why does the error keep coming back after I raise the limit?
The error returns when the slow task still needs more time than the new limit, or when your host resets the value. It also returns when a plugin or theme has a loop or a very slow request that no sensible limit will fix. Find the item that causes it by deactivating plugins one by one, then replace or fix that item.
Can I fix this error from the WordPress dashboard alone?
Yes, if you can reach the dashboard. Use Recovery Mode from the fatal error email to reach the dashboard, then deactivate the plugin or theme that caused the error. You can also install a plugin that raises the limit to 300 seconds. If you cannot reach the dashboard at all, edit wp-config.php or .htaccess by FTP or File Manager.
Is the maximum execution time error the same as a 504 gateway timeout?
No. The maximum execution time error is a PHP fatal error that names the script and the seconds it ran. A 504 gateway timeout comes from the web server or a proxy when it waits too long for a reply. The two errors can appear together, but they have different causes, so check the exact message before you pick a fix.
Sources
- PHP: Runtime Configuration PHP Manual
- PHP: set_time_limit PHP Manual
- Common WordPress errors WordPress Documentation
- How to Fix the WordPress max_execution_time Fatal Error Kinsta
- How to test for plugin and theme conflicts WooCommerce
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
