Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Fix Fatal Error: Maximum Execution Time Exceeded in WordPress

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.

Fix Fatal Error: Maximum Execution Time Exceeded in WordPress Easily

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.

Maximum Execution Time of 30 Seconds Exceeded Error in WordPress

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.

Technical difficulties

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.

Technical issue email sent to admin

The email will also include a special link.

This will allow you to log in to WordPress using ‘Recovery mode’.

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.

WordPress .htaccess File in Filezilla

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.

View/Edit .htaccess File in WordPress

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.

Adding Code to .htaccess File WordPress

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

68 CommentsLeave a Reply

  1. 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!

  2. 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

    • 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

  3. 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.

  4. 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 !

  5. I was very upset for this problem. After reading your article this problem has solved.
    Thank you so much.

  6. 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?

    • 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

    • 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

  7. 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

  8. 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…

  9. 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

    • 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

  10. 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 :(

  11. 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

  12. 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.

    • 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.

  13. 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? :(

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.