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

WordPress is coded mainly in the PHP programming language. To protect web servers from abuse, there is a time limit set for how long a PHP script can run.

The actual time limit varies across hosting companies. However, most of the time, the maximum execution time is 30 – 60 seconds because that’s usually enough for a good PHP script to run.

When a script reaches the maximum execution time limit, it results in the maximum execution time exceeded error on your WordPress website.

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 one of the most common WordPress errors, and you can easily fix it.

That being said, 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.

Use WordPress Recovery Mode

Depending on when and where the error is triggered, WordPress may show the ‘This site is experiencing technical difficulties’ error message to your website visitors.

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.

Edit Your .htaccess File

However, if you don’t want to deactivate a plugin, then you can fix the underlying cause that triggered the error.

To fix the 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 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 this line 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.

Adding Code to .htaccess File WordPress

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.

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.

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 check out our top picks for the best WordPress managed 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

65 CommentsLeave a Reply

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

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

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

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

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

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

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

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

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

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

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

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