Are you seeing ‘Fatal error: Maximum execution time of 30 seconds exceeded’ on your screen when trying to update a WordPress plugin or theme?
Typically, this problem occurs when a PHP script in WordPress takes a long time to run and reaches the maximum time limit set by your WordPress hosting server. The time limit is important because it helps prevent the abuse of server resources.
In this article, we will show you how to fix the fatal error: maximum execution time exceeded in WordPress.
Why Does the Maximum Execution Time Exceeded Error Happen?
The maximum execution time exceeded error happens in WordPress because PHP, the programming language behind WordPress, has a time limit for how long a script can run. This limit is in place to prevent web servers from being misused.
Different hosting companies set various time limits, but 30-60 seconds is often enough time. If a PHP script on your WordPress site takes longer than this set time, it triggers the maximum execution time exceeded error.
How to Fix the Maximum Execution Time Exceeded Error in WordPress
Although the maximum execution time exceeded error is called a ‘fatal error,’ it is actually one of the most common WordPress errors that are easy to fix.
Let’s look at how to fix the maximum execution time exceeded error in WordPress. You can use the links below to jump to the different troubleshooting methods:
Important: For the last two methods, we recommend backing up your WordPress to prevent errors from occurring on your website. Please read our guide on how to back up a WordPress website for more information.
Method 1: Use WordPress Recovery Mode
Depending on when and where the error is triggered, WordPress may show the ‘This site is experiencing technical difficulties’ error notification on the front end.
This is part of the fatal error protection feature added in WordPress 5.2.
You may also receive an email that will tell you which plugin (if a plugin triggered the error) caused the issue.
The email will also include a special link.
This will allow you to log in to WordPress using ‘Recovery mode’.
Once there, you can simply deactivate or delete the plugin causing the error.
For more details, please see our guide on how to use WordPress recovery mode and how to deactivate WordPress plugins.
Method 2: Edit Your .htaccess File
This method is recommended for WordPress users who are unable to access their WordPress dashboard. To fix the maximum execution time limit error, you will need to manually edit your .htaccess file and add a simple line of code.
Simply connect to your website using an FTP client or the File Manager app in your cPanel or other web hosting dashboard.
Your .htaccess file is in the same folder as your /wp-content/ and /wp-admin/ folders. If you can’t find it, then see our article on why you can’t find the .htaccess file and how to find it.
For example, if you are using FileZilla as your FTP client, then you can find it in the ‘Remote Site’ section in the right-hand column.
Once you find the .htaccess file, simply right-click it and select the ‘View/Edit’ option.
This will open the file within a text editor.
Next, you need to add the following code at the bottom of your .htaccess file:
php_value max_execution_time 300
If you are using Notepad as your text editor, here is how it may look.
Once that is done, go ahead and save the file.
This code simply sets the value for maximum execution time to 300 seconds (5 minutes). You can now visit your website to see if the error message is gone.
If you still get the error, then try increasing the value to 600.
If you found this method helpful, then check out the most useful .htaccess tricks for WordPress.
Method 3: Modify the php.ini File
Another method to fix the maximum execution time exceeded error in WordPress is by modifying your php.ini file.
The php.ini file is a configuration file that defines the settings for PHP on your server. On many WordPress hosting platforms, you may not see it inside your root folder.
In that case, you can create a new php.ini file inside your WordPress root folder using FTP or the File Manager app.
After that, simply edit the php.ini file and add the following line:
max_execution_time = 60
Don’t forget to save the file and upload your changes back to the server. You can now visit your website and to see if the error has gone.
In most cases, increasing the maximum execution time using these two methods will resolve the error. However, if it doesn’t, then you need to contact your WordPress hosting provider for assistance.
For more information about getting help for your WordPress site, read our guide on how to ask for WordPress support the right way.
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.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
afnan says
Thanks! it solved my issue.
WPBeginner Support says
Glad our article could help!
Admin
Ricky says
thank you so much bro!
WPBeginner Support says
You’re welcome!
Admin
Assadullah Shaikh says
That really helped, thanks mate!
WPBeginner Support says
Glad our guide was helpful!
Admin
faisalnawaz says
You are great, issue resolved. keep it up. once again Thank you.
WPBeginner Support says
Glad our guide was helpful
Admin
mudasir abbas turi says
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 says
Glad our guides have been helpful
Admin
nikos3194 says
Thanks so much for the help!
WPBeginner Support says
You’re welcome
Admin
pradip says
Thanks for this great article. My problem is solved
WPBeginner Support says
Glad our guide was able to help you
Admin
Ranjeet Gaur says
How to solve this issue on local hosted WordPress on XAMPP
WPBeginner Support says
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 says
Great,it’s work for me
WPBeginner Support says
Glad our guide was helpful
Admin
Tanbir says
not solving by this instruction..what i do now
WPBeginner Support says
Reach out to your hosting provider and they should be able to assist
Admin
Umesh Vinayak Shejole says
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 says
Glad our guide was helpful
Admin
MITESH says
have just paste a code in bottom and its all done
WPBeginner Support says
Glad our recommendation was helpful
Admin
Lyubomir says
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 says
You’re welcome, glad our guide was able to help
Admin
Al-Amin Khan says
I was very upset for this problem. After reading your article this problem has solved.
Thank you so much.
WPBeginner Support says
Glad our guide could help
Admin
Shubham Vats says
Thank You so much brother
WPBeginner Support says
You’re welcome, glad our guide could help
Admin
Quy says
Hi there,
thanks for posting this very useful info.
It helps me a lot.
Wishing you all the best,
Quy
WPBeginner Support says
Glad our guide could be helpful
Admin
Karina says
I followed the steps but It didn’t work, shows 500 internal error message and site went down.
WPBeginner Support says
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 says
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 says
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 says
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 says
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 says
Hey Mubarak,
Please follow the instructions in the article above. Let us know if they don’t work out for you.
Admin
Aman Gupta says
My WordPress site loads after showing an error for 2 seconds ..
Jeppe Bech says
Neither of the solutions worked for me.
Prof C M Sharma says
Thanks for the simple yet working solution!
Shahrukh says
The plugin works very well for me. Thanks a lot
mohammad says
Thank you. Problem solved..
MU says
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 says
Tanks . There problem solved
Waqas says
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 says
I am placing this comment to subscribe to my previous comment.
WPBeginner Support says
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 says
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 says
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 says
At the bottom of the file.
Admin
Ahmad says
It doesn’t work shows 500 internal error message and site went down.
srinivas says
php_value max_execution_time 300
php_value max_input_time 300
syed shahid says
Thank you Sir
Helpful article I solve my problem
Tehseen says
I am getting this error on local host. will this method solve my problem?
Zied says
yes, this will fix it
Ellayararwhy says
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 says
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 says
Thank you for the help!
SHABBIR says
Thanks for this great article.
Mohsin says
Thanks for great article
WPBeginner Staff says
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 says
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 says
Yes, it would work on local installs as well.
Keith Davis says
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 says
Superb it works just fine, on a local install as well