To a WordPress site owner, few things are more frustrating than a fatal error mid-upload or during a plugin install.
The “max_execution_time error” formally displayed as “Fatal error: Maximum execution time of 30 seconds exceeded” is one of the most common WordPress errors, and fortunately one of the most fixable.
However, it is pretty simple to resolve this error by increasing the max execution time. This guide covers six methods to increase max execution time in WordPress, explains what causes the error, and shows you how to check your current settings before anything breaks.
- What is max_execution_time in WordPress?
- What causes the “Maximum execution time exceeded” error?
- Why you need to increase max_execution_time for large file uploads
- How to check your current max_execution_time setting
- How to Identify the max_execution_time Error on Your Site
- 6 Methods to fix the max_execution_time error
- Summary and recommended values
What is max_execution_time in WordPress?
max_execution_time is a PHP configuration setting that defines the maximum number of seconds a single PHP script is allowed to run on your server. Once a script exceeds this limit, PHP automatically terminates it and throws a fatal error.
By default, most WordPress hosting environments set this value to 30 seconds. Tasks like importing large XML files, uploading videos, running WooCommerce exports, or installing resource-heavy plugins can easily exceed this limit.
💡 Key Fact: WordPress recommends a minimum max_execution_time of 300 seconds for optimal performance, especially on eCommerce or content-heavy sites.
Cloudways Performance Bootcamp · Free · Mar 10–11
From CDN to Core Web Vitals, watch experts fix real WordPress performance issues, live.
What causes the “Maximum execution time exceeded” error?
The error message looks like this:
Fatal error: Maximum execution time of 30 seconds exceeded in /path/to/your/script.php on line Y
Common triggers include:
- Installing or updating a poorly optimized plugin or theme that consumes excessive server resources
- Uploading large media files such as high-resolution images or lengthy videos
- Running database import/export operations (especially large SQL or XML files)
- Using shared hosting with a very low execution time limit (sometimes as low as 15–30 seconds)
- Outdated or conflicting plugins that cause PHP scripts to loop indefinitely

Source: YouTube/wpguide
Why you need to increase max_execution_time for large file uploads
If the file you want to upload is large, then the PHP script that handles the upload process may run for more than the specified time limit of the server, as explained earlier.
This can lead to issues such as files not being fully uploaded, server errors, and one thing you cannot afford at all: poor experience for the users.
Essentially, what you are doing when you increase max execution time, is increasing the time that the script has to run, meaning that large files can be uploaded without errors.
What If You Don’t Increase max_execution_time for Large Uploads?
There are several risks if you choose to keep your execution time limited and ignore the errors. The risks include:
- Files may be corrupted or lost due to incomplete uploads.
- Timeouts and internal server errors can occur.
- User frustration and lost business opportunities.
- Malicious files can be uploaded.
How to check your current max_execution_time setting
There are several ways to check your current max_execution_time setting, but the easiest one is to use the Health Check & Troubleshooting plugin.
Here’s how:
1. Go to your WordPress dashboard.
2. On the left panel, click Plugins > Add New Plugin.
3. In the search bar on the right, type “Health Check & Troubleshooting”.
4. Click on Install.

5. Once installed, click on Activate.

6. Once the plugin is set to go, on the left panel again, look for Tools > Site Health.

7. Click on Info (next to Status) and then scroll down to Server.

8. In the server dropdown, you will find “PHP time limit”. In my case, it says “60”, which means 60 seconds.

How to identify the error on your site
Usually, WordPress will send site owners and WordPress admins an email informing them that a plugin or theme is causing a Fatal Error.

Other than that, while you’re uploading a plugin or theme, your dashboard will display the following message too.
Another way to find out if there is a max_execution_time error on your site is to see what’s happening on the front end. The message to users may read:
“The site is experiencing technical difficulties”
Or
“There has been a critical error on your website”
Find Out How to Fix 25+ Most Common WordPress Errors.
How to Fix max_execution_time Error and Increase the Limit
There are six methods to resolve the max_execution_time error in WordPress. The first one would be to get rid of any problematic plugins or themes on the website.
The rest would be to increase the max execution time.
| Method | Approach | Difficulty | Best For |
|---|---|---|---|
| Method 1 | Uninstall the problem plugin/theme | Easy | Beginners |
| Method 2 | Use a plugin | Easy | Non-technical users |
| Method 3 | Edit .htaccess | Intermediate | Apache servers |
| Method 4 | Edit wp-config.php | Intermediate | All environments |
| Method 5 | Edit php.ini | Advanced | VPS/dedicated hosting |
| Method 6 | Contact hosting support | Easiest | Shared hosting users |
Method 1: Uninstall the Problem Plugin or Theme
If the problem appeared after the plugin or theme installation, you can assume it’s the one causing the problem.
- Go to Plugins > Installed Plugins
- Find the recently installed or updated plugin
- Click Deactivate beneath its name
- Reload your site to confirm the error is resolved
We have a blog about how to disable or delete plugins, if you want to learn in depth.
But if the recently downloaded plugin does not turn out to be the problem and your WordPress error remains, how do you find out what the issue is?
Consider these factors:
- Check your email for any error notifications from WordPress
- Deactivate each plugin one at a time to identify which one could be the culprit.
- Maybe downgrade the WordPress version. The latest WordPress update can sometimes be causing issues.
💡Downgrading your WordPress version should be your last choice. The latest WordPress versions are very important for your website’s performance and security.
If this doesn’t work, you simply increase the max execution time on your WordPress website. The following methods will teach you how to do that.
Method 2: Using a Plugin to Increase Execution Time
Using a plugin to increase max execution time in WordPress is a very good choice for those who aren’t comfortable with technical options like modifying server files.
For this tutorial, I have used the Increase Maximum Upload File Size | Increase Execution Time plugin. It has 70,000+ active installations and was updated yesterday (at the time of writing), which means it has been tested with WordPress 6.7, the latest version of WordPress.
To activate this plugin:
- Go to your WordPress dashboard.
- On the left panel, click on Plugins > Add New Plugin
- In the search bar, type Increase Maximum Upload File Size | Increase Execution Time.
- Click on Install.
- Click on Activate.

To increase the execution time, take these steps:
1. On the left panel, click on Media > Increase Upload Limit.

2. Enter the time of your choice in the Maximum Execution Time section on top, below “Maximum Upload Size”

💡It is recommended not to exceed 300 seconds for the maximum execution time.
Method 3: Modifying the .htaccess file to Increase Max Execution Time
To increase the max execution time via .htaccess, you will need to connect to your server through an FTP client.
- To do this, download and install an FTP client like Filezilla.
- Then connect to your server by adding your credentials.
Cloudways users can find their credentials when the click on All Servers and pick the server they want to connect:

- Click quickconnect to access your files.
Here is what it looks like after I added my credentials:

Once you’re connected, access the .htaccesss file.
❗Before you modify your .htaccess, it is very important to back up all your WordPress files.
Secure Your WordPress Site with Automated Backups
Data loss isn’t a thing with Cloudways. Customize your backup frequency, easily download backups locally, or even clone a website from existing backups.
Once backed up, take these steps:
1. Locate the .htaccess file in /public folder.
2. Right-click the .htaccess file in your FTP client (e.g., FileZilla) and select Edit.
3. If you’re using an editor on your local computer, download the file first, edit it, and then upload it back after saving.

4. Add the following line: php_value max_execution_time 300.
Typically, place this line near the top of the .htaccess file, especially before any rewrite rules.
Method 4: Editing the wp-config.php
Another easy method of increasing execution time is to configure the wp-config.php file. Just like .htaccess method mentioned above, for wp-config.php, you will have to connect with a file client like Filezilla.
1. Locate the .wp-config.php file in /public folder.
2. Open the file for editing.

3. Add the following code at the end, just before it says “stop editing”: set_time_limit(300);

Save and upload this new file on your website through FTP.
Method 5: Editing the php.ini to Increase Max Execution Time
You can fix the max execution time error and increase the time by editing php.ini too, if your server uses that file for configuration.
To do so, take these steps:
Once connected, take these steps:
- Locate the php.ini file in /public folder.
- Open the file for editing.
- Add the following line: max_execution_time = 300

You can replace “300” with any other value you have in mind.
This method is uncommon but definitely one way you can modify maximum execution.
Method 6 (Easiest): Request Your Hosting Provider to Increase Max Execution Time
If you’re unsure about making the changes yourself, you can always reach out to the support team of your web hosting provider, show them the error that you saw, and ask them what your current execution limit is.
Then, you can tell them to increase this execution time to somewhere between 60 and 300.
In cases like these, it’s important to understand the role of the type of hosting you have. With managed WordPress hosting or VPS hosting, you can manually adjust these settings because you have full control over them.
But, if you have shared hosting, resolving errors can be troublesome. Why? Because changes made to one website can affect sites others too (i.e. the sites you’re sharing your hosting with).
Cloudways offers hosting for WordPress with 24/7 expert support where you can talk to actual humans (and not bots), that is, senior engineers, to discuss your troubles and get them resolved.
These experts work as part of your team and have an average response time of 90 seconds.

Troubleshooting Errors is Easy with Cloudways Managed Hosting
Experience Error-free WordPress Hosting. Start now and see how easy it is to run your website!
Summary
It is crucial to increase max_execution_limit on your WordPress website, especially when it comes to uploading large files.
In this tutorial, you found 6 different methods to change the max_execution_limit to resolve the max execution error. You also learned how you can figure out what plugins or themes may be causing your website trouble and how you can get rid of them.
Recommended max_execution_time Values
| Value | When to Use |
|---|---|
| 30 seconds | Server default — often too low for modern WordPress |
| 120 seconds | Good for most standard WordPress setups |
| 300 seconds | Recommended for WooCommerce, large media, imports |
| 0 (unlimited) | Never use on production sites |
If you’re a Cloudways customer, remember you can always reach out to our support team where our senior engineers will respond to you within 90 seconds and make sure to increase your limit for you so you can focus on your business, while we iron things out.
Q. How do I increase max_execution_time for importing large XML files?
A. Edit your php.ini and set max_execution_time = 300, or use .htaccess with php_value max_execution_time 300. On shared hosting, ask your provider directly.
Q. What is the maximum recommended value for max_execution_time?
A. 300 seconds (5 minutes) is the widely recommended ceiling. Values above 300 can strain server resources and allow runaway scripts to consume memory.
Q. What happens if max_execution_time is set too low?
A. PHP terminates the running script early, causing incomplete uploads, corrupted files, HTTP 500 errors, and a broken user experience — especially on eCommerce or media-heavy sites.
Q. Can I set max_execution_time to 0?
A. Yes, but never on a production site. Setting it to 0 removes the time limit entirely, allowing scripts to run indefinitely — a serious security and performance risk.
Q. Does max_execution_time affect front-end page load speed?
A. Not directly. It only applies to PHP script execution server-side. However, very long-running scripts can consume server resources and indirectly slow things down for other users.
Hafsa Tahir
Hafsa is a content marketer who has been in the organic growth space for the past three years. With her background in Psychology and UX, she enjoys reading users' minds and is keen to try the most creative product marketing angles. Her copies scream: "you're not just a paycheck to us". Loves to crack unfunny jokes, pay gym fee and not go, and write psychologically disturbing short stories for some reason.