Seeing a message like ‘Fatal error: Maximum execution time exceeded’ can definitely make your heart skip a beat. It sounds serious and often locks you out of your WordPress admin area, which is incredibly frustrating.
We’ve been there. When managing our own WordPress websites, we’ve found that this error usually pops up when a script, like one from a plugin or theme update, needs a little more time to finish than your server allows.
The good news is that despite its intimidating name, this is a common issue with a straightforward fix. You don’t need to be a developer to solve it.
In this guide, we will show you exactly how to fix the maximum execution time exceeded error and get your WordPress site running smoothly again.
How to Fix Maximum Execution Time Exceeded Error: The Quick Fixes
The most common solutions for this error involve slightly increasing the time limit for PHP scripts. You can do this by editing a file on your server, such as your .htaccess or wp-config.php file. Often, the error is caused by a faulty plugin, which you can resolve using WordPress’s built-in Recovery Mode.

Why Does the Maximum Execution Time Exceeded Error Happen?
The maximum execution time exceeded error in WordPress happens because a PHP script takes longer to run than the limit set by your web hosting server. PHP is the programming language that powers WordPress, and this time limit is a safeguard to prevent server resources from being abused.
Most hosting companies set this time limit to between 30 and 60 seconds. If a script for a plugin, theme, or WordPress core update takes longer than that to complete, then PHP stops the script and generates a fatal error.

How to Fix the Maximum Execution Time Exceeded Error in WordPress
Although it’s called a ‘fatal error,’ this is one of the most common WordPress errors you can run into. Luckily, it’s usually quite simple to resolve.
Below are several methods you can try to fix it:
- Method 1: Use WordPress Recovery Mode
- Method 2: Edit Your .htaccess File
- Method 3: Modify the php.ini File
- Method 4: Edit Your wp-config.php File
- Method 5: Optimize Your WordPress Database
- Method 6: Check Your WordPress Plugins
- Method 7: Upgrade Your Hosting Plan
- Method 8: Get WordPress Support
- Frequently Asked Questions About the Maximum Execution Time Error
- Additional WordPress Troubleshooting Guides
Feel free to use the quick links above to jump to any method.
Important: Before making any changes, we recommend backing up your website to prevent data loss. You can use a trusted plugin like Duplicator or follow our guide on how to back up a WordPress website for more information.
Method 1: Use WordPress Recovery Mode
In our experience, if a plugin is the culprit, then WordPress’s built-in recovery mode is the easiest first step to try. This feature was added in WordPress 5.2 to help you access your site even when a fatal error occurs.
When the error is triggered, WordPress may show a ‘This site is experiencing technical difficulties’ message on the front end.

You should also receive an email with a special link to log in using ‘Recovery Mode.’
The email will often tell you which plugin caused the issue.

Once you click the link and enter recovery mode, you can safely deactivate or delete the plugin that’s causing the problem.
For more details, please see our guides on how to use WordPress recovery mode and how to deactivate WordPress plugins.

Method 2: Edit Your .htaccess File
We find this method is particularly effective for users who are locked out of their WordPress admin dashboard and cannot use recovery mode. You will need to connect to your site’s files directly to add a simple line of code to your .htaccess file.
You can do this using an FTP client or the File Manager app in your hosting control panel. Our developers often use FileZilla for this task.
Your .htaccess file is located in your site’s root directory, the same folder as /wp-content/ and /wp-admin/. If you can’t see it, check our guide on how to find the .htaccess file.

Once you locate the file, right-click and choose ‘View/Edit’.
This will open it in a text editor.

Now, add the following line of code at the very bottom of the file:
php_value max_execution_time 300 After adding the code, save your changes and upload the file back to your server. This code sets the maximum execution time to 300 seconds (5 minutes), which should be enough for most scripts to run.
Please note that this method is server-dependent and may not work on all hosting configurations. If it causes a new error (such as a 500 internal server error), simply remove the line you added and save the file again. Then, proceed to the next method.
Method 3: Modify the php.ini File
This is another reliable method, and we’ve seen it work on hosting environments where .htaccess modifications are restricted. It involves editing your server’s main PHP configuration file, which is called php.ini.
First, check your hosting control panel (like cPanel or Plesk) for a tool called ‘MultiPHP INI Editor’ or ‘PHP Configuration.’ This is the easiest and safest way to make changes.
If you cannot find such a tool, you can create a new file named php.ini in your WordPress root folder. Then, edit the file and add the following line:
max_execution_time = 300 Don’t forget to save the file. You can now visit your website to see if the error is resolved.
Method 4: Edit Your wp-config.php File
Our team often uses this method as a more targeted approach, as it directly tells WordPress to override the default server settings. This involves editing your wp-config.php file.
This change attempts to increase the time limit specifically for the WordPress PHP scripts as they run. It does not affect your entire server, only the WordPress application.
Using an FTP client or File Manager, locate the wp-config.php file in your WordPress root directory. Paste the following line just before the line that says /* That's all, stop editing! Happy publishing. */:
set_time_limit(300); Save your changes, and then check your website to see if the error has been fixed. We recommend starting with 300 seconds to see if it solves the issue.
Method 5: Optimize Your WordPress Database
We’ve seen cases where a bloated database directly contributes to script timeouts. This often happens with older sites that have accumulated thousands of post revisions, expired transients, or orphaned data from old plugins.
Regularly optimizing your database cleans out this unnecessary data. This not only fixes the execution time error but can also improve your overall website speed.
See our step-by-step guide on how to optimize your WordPress database.
Method 6: Check Your WordPress Plugins
From our experience troubleshooting hundreds of WordPress sites, a poorly-coded or resource-intensive plugin is the most common cause of the maximum execution time error.
While plugins add great features, they can sometimes cause problems.
To check if a plugin is the culprit, you can temporarily deactivate all of your plugins. If the error goes away, you know a plugin is to blame.

Next, reactivate them one by one, checking your site after each activation. When the error returns, you’ve found the problematic plugin.
If you can’t access your admin area, we have a guide on deactivating plugins when you can’t access wp-admin. Once you find the plugin, you can contact its author for support or find an alternative.
Method 7: Upgrade Your Hosting Plan
After we’ve exhausted all other software-level fixes, we often advise clients that the root cause is the resource limitation of their hosting plan. If you are on a basic shared hosting plan, you may simply be outgrowing its resources.
Upgrading your hosting often provides a permanent solution. Companies like SiteGround (which we use at WPBeginner), Bluehost, and Hostinger offer WordPress-optimized plans configured to handle these common issues out of the box.
You can read our guide on how to choose the best WordPress hosting for more details.
Method 8: Get WordPress Support
If you’ve tried the methods above and are still unable to resolve the issue, we strongly recommend contacting your hosting provider’s support team. They can check server-side logs that are inaccessible to you, which can often pinpoint the exact cause of the problem.
You can also join a helpful community like our WPBeginner Engage Facebook group to ask fellow WordPress users for advice.

Frequently Asked Questions About the Maximum Execution Time Error
Here are some of the most common questions we get asked about this particular WordPress error.
What is a good maximum execution time value?
We recommend starting with a value of 300 seconds. This is usually more than enough time for most long-running PHP scripts to complete without being so high that it poses a risk to server stability.
Can my WordPress theme cause this error?
Yes, absolutely. A poorly coded theme or a theme with very complex features that require significant processing can sometimes trigger the maximum execution time error, especially during updates or when importing demo content.
Will increasing the execution time slow down my site?
No, increasing the maximum execution time will not slow down your website. This setting is a limit, not a target. It simply gives legitimate, long-running processes more time to complete successfully, which has no negative impact on your site’s normal loading speed for visitors.
Additional WordPress Troubleshooting Guides
Experiencing other types of WordPress errors? These guides may be able to help you out:
- How to Fix the WordPress Failed to Open Stream Error
- How to Fix WordPress Posts Returning 404 Error (Step by Step)
- How to Fix WordPress Login Page Refreshing and Redirecting Issue
- How to Fix the “Sorry, You Are Not Allowed to Access This Page” Error in WordPress
- How to Fix WordPress Updating Failed / Publishing Failed Error
- How to Fix the WordPress White Screen of Death (Step by Step)
- Fix: WordPress Memory Exhausted Error – Increase PHP Memory
- How to Fix “PHP Missing MySQL Extension” Error in WordPress
We hope this article helped you fix the fatal error: maximum execution time exceeded in WordPress. You may also want to see our guide on how to fix the error establishing a database connection in WordPress and our top picks for the best managed WordPress hosting providers.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Mrteesurez
I am happy to discovered way to fix this error “Fix Fatal Error: Maximum Execution Time Exceeded” I have noticed that the error usually comes out when a site takes too long to open or load a page. So I presumed it’s browsers fault not know it’s from host.
Please what is the implication of keeping the duration higher than 5 minutes, what possible happened ?
WPBeginner Comments
A problem that may occur if the execution time is too long is that the site will take to long to load or process, or that the site may be overloaded.
So it’s about striking a good balance between the server capacity, load time, and site needs.
Mrteesurez
Thanks for your answer.
You’re absolutely right—finding that balance is key. I’ve encountered situations where long execution times caused site slowdowns and even timeouts, especially during high traffic performance to ensure it can handle the load efficiently without compromising on user experience. I appreciate your support.
Jiří Vaněk
What do you think is a reasonable maximum of this value? Sometimes some plugins, especially for import and export, need quite a lot of time before performing an action. So I would be interested in what value it is no longer good to get over, because it could mean, for example, a security risk.
WPBeginner Support
Starting with 60 is normally a good way to test and then it would depend on the specific task for how much to increase it or if the host needs to be checked with for an error.
Admin
Jiří Vaněk
Thank you for answer. I currently have a limit of 300 and then that’s enough. So I’ll leave it at this value then we’ll see. When I put it lower, I sometimes don’t fit into the limits. Thank you. I will definitely not increase the limit then.
afnan
Thanks! it solved my issue.
WPBeginner Support
Glad our article could help!
Admin
Ricky
thank you so much bro!
WPBeginner Support
You’re welcome!
Admin
Assadullah Shaikh
That really helped, thanks mate!
WPBeginner Support
Glad our guide was helpful!
Admin
faisalnawaz
You are great, issue resolved. keep it up. once again Thank you.
WPBeginner Support
Glad our guide was helpful
Admin
mudasir abbas turi
when ever i have face with problem then i search on google i found your website and i have always solve my problem from your website thanks too much
WPBeginner Support
Glad our guides have been helpful
Admin
nikos3194
Thanks so much for the help!
WPBeginner Support
You’re welcome
Admin
pradip
Thanks for this great article. My problem is solved
WPBeginner Support
Glad our guide was able to help you
Admin
Ranjeet Gaur
How to solve this issue on local hosted Wordpress on XAMPP
WPBeginner Support
You would use the same method, you may want to ensure the file isn’t already created under xampp/php in which case you would want to edit the file there.
Admin
Muhammad Hassan Kareem
Great,it’s work for me
WPBeginner Support
Glad our guide was helpful
Admin
Tanbir
not solving by this instruction..what i do now
WPBeginner Support
Reach out to your hosting provider and they should be able to assist
Admin
Umesh Vinayak Shejole
It’s working properly. I am installed premium shopping theme & got error when installing required plugins. After putting php_value max_execution_time 300 line in my .htaccess file it’s working & being installed all required plugin. I am trying from last 2 / 3hrs with this problem. Thank you for saving lot’s of time.
WPBeginner Support
Glad our guide was helpful
Admin
MITESH
have just paste a code in bottom and its all done
WPBeginner Support
Glad our recommendation was helpful
Admin
Lyubomir
Thanks a lot for the great article !
It resolved my issue – it happened on trying to upgrade my localhost WordPress installation from v.5.2.5 to v.5.3.2
Adding the line “php_value max_execution_time 300” at the bottom of the .htaccess file proved to be enough, in my case.
Best regards !
WPBeginner Support
You’re welcome, glad our guide was able to help
Admin
Al-Amin Khan
I was very upset for this problem. After reading your article this problem has solved.
Thank you so much.
WPBeginner Support
Glad our guide could help
Admin
Shubham Vats
Thank You so much brother
WPBeginner Support
You’re welcome, glad our guide could help
Admin
Quy
Hi there,
thanks for posting this very useful info.
It helps me a lot.
Wishing you all the best,
Quy
WPBeginner Support
Glad our guide could be helpful
Admin
Karina
I followed the steps but It didn’t work, shows 500 internal error message and site went down.
WPBeginner Support
For fixing the 500 error, you would want to go through the steps in our article here: https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/
Admin
Amelia John
Hey Dears,
I am getting a maximum execution time limit error like below when clicking on the woocommerce settings tab. I added max_execution_time = 360 to php.ini file however it’s not working as well.
Deactivated every plugin by keeping woo-commerce only also changed to a default WordPress theme, none of these steps work for me.
Any good hearts here to help me to sort out this issue?
WPBeginner Support
Reach out to your hosting provider to see if they have an overriding setting preventing you from changing the execution time for your site. That could be the likely reason
Admin
Kaan Oezgiray
Try this in your script (I placed it on the first line and it works):
ini_set(‘max_execution_time’, ‘600’);
Hope it helps.
-Kaan
mubarak hassan
How can I solve this? Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\wp\wp-includes\Requests\Transport\cURL.php on line 163
WPBeginner Support
Hey Mubarak,
Please follow the instructions in the article above. Let us know if they don’t work out for you.
Admin
Aman Gupta
My WordPress site loads after showing an error for 2 seconds ..
Jeppe Bech
Neither of the solutions worked for me.
Prof C M Sharma
Thanks for the simple yet working solution!
Shahrukh
The plugin works very well for me. Thanks a lot
mohammad
Thank you. Problem solved..
MU
down vote
You have to just check whether your WAMP server is online or not.
To put your WAMP server online, follow these steps.
Go to your WAMP server notification icon (in the task bar).
Single click on the WAMP server icon.
Select last option from the menu, that is, Put Online
Your server will restart automatically (in the latest versions only). Otherwise, you have to restart your server manually.
And you are DONE…
sina
Tanks . There problem solved
Waqas
Hi, I have been facing this issue for along time don’t know how to solve it.
I am getting this error while visiting my homepage Warning: session_start(): open(/tmp/sess_e8717886215bae41c9c82993bd822901, O_RDWR) failed: Disk quota exceeded (122) in /home/waqas1385/public_html/example.com/wp-content/plugins/easy-contact/econtact.php on line 112
I have searched my whole site but I don’t have this plugin ‘easy contact’ installed and I can’t find it in the file manager.
please help me how to fix this error. Thanks
Waqas
I am placing this comment to subscribe to my previous comment.
WPBeginner Support
Hi Waqas,
Try using an FTP client and locate this folder manually. Make sure that your FTP client is set to show hidden files too.
It seems that some poorly coded plugin is starting sessions and your server is unable to delete temporary session files. It could also be caused by a temporary files stored elsewhere like your web hosting mailboxes.
Admin
Jess
This didn’t work for me, now I can’t even get to the log in page and it gives an error message for my whole site
Ahmad
Hi I am using php 5.5
When i open .htaccess code editor in cpanel i see the following text
where should i exactly add this code and save it?
# Use PHP55
AddHandler application/x-httpd-php55 .php
suPHP_ConfigPath /opt/php55/lib
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
WPBeginner Support
At the bottom of the file.
Admin
Ahmad
It doesn’t work shows 500 internal error message and site went down.
srinivas
php_value max_execution_time 300
php_value max_input_time 300
syed shahid
Thank you Sir
Helpful article I solve my problem
Tehseen
I am getting this error on local host. will this method solve my problem?
Zied
yes, this will fix it
Ellayararwhy
This doesn’t fix the underlying problem at all, which is that something running under WP is totally consuming CPU resources. To suggest that just increasing the timeout value is a fix is not good practice – focus on the root cause.This can happen in many ways (apache library, synchronous read, etc), but the usual culprits are some PHP code in some WP plug-in stuck in a very long or infinite iteration loop. Perhaps there is a weird interaction between two or more WP plugins.
In all scenarios, including ones not discussed, is that you have to back off (disable) your WP plugins until the CPU load decreases to a reasonable value. The next step is to figure out how to track down a plugin problem or plugin interaction issue, which may involve quality time on forums focused on the suspect plugins.
Leo
I agree with @ELLAYARARWHY. The point of setting max execution time is for security and the users experience, changing the settings this way to me is only putting a patch on the issue rather then actually fixing it. Increasing the time is not a long term solution.
Andrea Moor
Thank you for the help!
SHABBIR
Thanks for this great article.
Mohsin
Thanks for great article
WPBeginner Staff
you can try max upload filesize in php.ini file located in your WAMP directory. Alternately you can try Splitting up XML file you are trying to import.
ZS
I have WordPress 4.1 installed on XAMPP. I didn’t have any .htaccess files in the wp-content and wp-admin folders. I added them myself with the code you mentioned but that didn’t fix the error. I’ve also tried installing the plugin and that also did not fix the error.
I tried running WordPress on WAMP and I am getting the error on WAMP too. I am getting this error when I try to import the Theme Unit Test XML file. What else can I do?
WPBeginner Staff
Yes, it would work on local installs as well.
Keith Davis
Hi Syed
I’ve had that error message a few times when updating WordPress local sites using XAMPP.
Would this solution work on a local install.
Atwine
Superb it works just fine, on a local install as well