How to fix the max_execution_time error in WordPress

Are you getting the error message Maximum execution time of 30 seconds exceeded or max_execution_time when using WordPress? Don’t worry. This error means that the PHP script you were running took longer to complete than the limit allows. Read on to learn how to resolve this error on your website.

Fix max_execution_time error in WordPress

There are three methods that you can use to fix the maximum execution time error in WordPress: edit the .htaccess file, change the time limit from the control panel and install a plugin.

Edit the .htaccess file manually

By default, the max_execution_time is usually set to 30 seconds. If your PHP scripts need more time then you should edit the value in the .

This is how you can do it:

  1. Open the File Manager in the hPanel and navigate to the directory public_html.
  2. Double click on the file .htaccess.
  3. Insert the following code at the bottom of your file .htaccess:
    php_value max_execution_time 60
  4. press Save and Close.

If it still gives you the same error, you can try increasing the value to 120-180 seconds

Change the value of max_execution_time via hPanel

You can also increase the max_execution_time of WordPress directly from Configuration of PHP in the hPanel.

  1. Login to the hPanel and navigate to PHP configuration in the section Advanced.
  2. Select the tab PHP Options and scroll down until you find the option max_execution_time.
  3. Increase the default value as needed and click Save.

That’s it, you have successfully increased the limit of max_execution_time of your PHP script in WordPress.

See also  How to create a free web page? - Explanatory video

Install a plugin to increase the execution time limit

An easy way to fix WordPress max_execution_time error is by using a plugin. We recommend using as it is simple.

  1. and activate the plugin Google Pagespeed Insights from your WordPress dashboard.
  2. go to Tools -> Pagespeed Insights. Go down, search Advanced configuration and change the maximum execution time as needed. However, we recommend using the default settings as it will work fine on most websites.
  3. click on Save Options and the plugin will automatically modify the file .htaccess.

If you want to undo any changes, simply deactivate the plugin and all changes made to it. .htaccess they will be removed.

conclusion

You have learned three easy ways to fix the error max_execution_time in WordPress. Here’s a quick rundown of those methods:

  1. Insert the code php_value max_execution_time 60 in the .htaccess file.
  2. Extend the limit directly through PHP Settings in the hPanel.
  3. Increase the time limit using the plugin.

There you have it, quick and easy solutions. If you use a shared hosting service and none of the solutions have worked for you, contact your hosting provider and ask if it is possible to increase the maximum execution time. Good luck!

Gustavo is passionate about creating websites. He focuses on the application of SEO strategies at for Spain and Latin America, as well as the creation of high-level content. When he is not applying new WordPress tricks you can find him playing the guitar, traveling or taking an online course.

Loading Facebook Comments ...
Loading Disqus Comments ...