How to

Maximum Execution Time Exceeded in WordPress: 4 Easy Fixes

You try to update a large plugin, run an automated site backup, or import an XML demo file, and your browser suddenly throws this fatal error:

Fatal error: Maximum execution time of 30 seconds exceeded in /home/username/public_html/…

This error occurs when a PHP script on your website takes longer to run than the maximum time limit allocated by your web server.

Web servers enforce execution limits to stop poorly written scripts from running indefinitely and consuming all server CPU power. However, intensive operations—such as restoring backups, updating WooCommerce catalogs, or importing demo data—often need more than 30 seconds to finish.

In this guide, we will show you four simple ways to increase your PHP limit and fix the maximum execution time exceeded error in WordPress.


Fix 1: Modify Your .htaccess File

The most common and effective method for Apache web servers is adding an execution directive to your .htaccess file.

  1. Log in to your hosting cPanel, open File Manager, and go to your public_html root directory.
  2. Locate the .htaccess file. (Make sure Show Hidden Files is turned on in Settings).
  3. Right-click and select Edit.
  4. Paste the following line at the very bottom:
php_value max_execution_time 300

This raises your timeout window from 30 seconds to 300 seconds (5 full minutes). Save changes and test the operation that was timing out.


Fix 2: Edit Your wp-config.php File

If you prefer modifying WordPress configuration files directly, you can define the limit in wp-config.php.

  1. In your public_html directory, open wp-config.php for editing.
  2. Find the line:
    /* That's all, stop editing! Happy publishing. */
  3. Right above it, paste:
set_time_limit(300);

Save the file and refresh your WordPress dashboard.


Fix 3: Update Your php.ini File

On servers where .htaccess directives are not supported, configuring your php.ini or .user.ini file will do the job.

  1. In public_html, locate or create a plain text file named php.ini.
  2. Add or modify this line:
max_execution_time = 300

Save the file. This tells PHP to allow up to 300 seconds for all executing scripts.


Fix 4: Contact Your Hosting Support

Some shared web hosting environments lock down PHP execution limits at the server root level. If your scripts still time out after trying the previous three methods, reach out to your web host.

Send them this quick ticket message:

Hi Support team,

My WordPress site is timing out with a “Maximum execution time exceeded” fatal error when updating plugins. I have attempted to increase max_execution_time to 300 via .htaccess, but the server is overriding it.

Could you please increase the max_execution_time limit on my account to 300 seconds?

Thank you!

Most reliable web hosting support teams will increase this limit immediately.

For additional WordPress performance guides, check our tutorials on solving the failed to write file to disk error and adjusting settings for 413 request entity too large issues.


Wrapping Up

The maximum execution time exceeded error is simply a timer running out on your server. Bumping the limit to 300 seconds ensures that heavy tasks like backups and updates finish cleanly without interruption.

Did increasing your execution time solve your issue? Let us know in the comments below!

Leave a Reply