How to Increase Maximum Execution Time in WordPress

The amount of time that a single PHP script can run on your server before it times out is determined by the maximum execution time. You must increase this limit if you see errors such as "Fatal error: Maximum execution time of 30 seconds exceeded".

To increase the maximum execution time in WordPress, you typically need to edit the "php.ini" file or the ".htaccess" file or the "wp-config.php" file. Here's how you can do it:

Method 1: Editing php.ini:

If you have access to your server's "php.ini" file, you can directly increase the maximum execution time there. Look for the line that sets "max_execution_time" and increase its value. For example:

max_execution_time = 300

Replace 300 with your desired maximum execution time limit. For example, '600' for 600 seconds. Save the php.ini file after making the change.

Method 2: Editing .htaccess

Also, you can increase the time limit by editing the .htaccess file in your WordPress installation directory. Add the following line:

php_value max_execution_time 300

Replace 300 with the maximum execution time you want. Save the .htaccess file after making the change.

Method 3: Editing wp-config.php:

Open your WordPress installation directory via FTP or the file manager provided by your hosting provider, and locate the wp-config.php file.

Add the following line of code to wp-config.php, preferably just before the line that says /* That's all, stop editing! Happy publishing. */:

set_time_limit(300);

You can replace '300' with the time limit you want to set. Save the wp-config.php file after making the change.

After making any of these changes, navigate to Tools > Site Health > Info in your WordPress admin dashboard to verify if the maximum execution time limit has increased. To confirm the new limit, look for the entry under "Server" for "Max execution time".

Note:
Keep in mind that in some shared hosting environments, you might not be able to increase the maximum execution time limit beyond a certain amount due to server resource limitations. If you have any questions or encounter any issues, you should contact your hosting company for assistance.

Our WordPress Themes

Below are some of our premium WordPress themes. View all our free and premium WordPress themes →
GreatWP PRO WordPress Theme

GreatWP PRO

If you like GreatWP free WordPress Theme, you will love the premium version. GreatWP PRO is very user friendly, feature-rich,...

$25.00
Simple Grid PRO WordPress Theme

Simple Grid PRO

You'll be pleased with the Simple Grid PRO WordPress theme if you have tried the free version. It is a...

$25.00
EliteWP PRO WordPress Theme

EliteWP PRO

If you like EliteWP free WordPress Theme, you will love the premium version. EliteWP PRO is an advanced, very user...

$25.00
GridBit PRO WordPress Theme

GridBit PRO

Are you looking for a feature-rich version of the GridBit Free WordPress Theme? Then you will fall in love with...

$25.00
EasyWP PRO WordPress Theme

EasyWP PRO

If you like EasyWP free WordPress Theme, you will love the premium version. EasyWP PRO is an user friendly, HTML5/CSS3...

$25.00
BestWP PRO WordPress Theme

BestWP PRO

If you like BestWP free WordPress Theme, you will love the BestWP premium version. BestWP PRO is user friendly, feature-rich,...

$25.00
CoolWP PRO WordPress Theme

CoolWP PRO

If you like CoolWP free WordPress Theme, you will love the premium version. CoolWP PRO is very user friendly, feature-rich,...

$25.00
GridShow PRO WordPress Theme

GridShow PRO

GridShow PRO WordPress theme is a feature-rich, advanced version of GridShow Free WordPress Theme. GridShow PRO version has color and...

$25.00

Can't you choose a single theme? Purchase All Themes for $75.

Save money with our low, one-time price for access to all of our 55 WordPress themes.