Increase Maximum Execution Time WordPress site

Looking solutions for How to Increase Maximum Execution Time WordPress site ?
If you getting a message like “Maximum execution time of 60 seconds exceeded” or “Maximum execution time of 30 seconds exceeded” or “504 Gateway time out”.
reason for above similar error is php script need more time to execute functionality than the default execution time available in Server. and due to short of execution time scripting not completed their process execution and hitting timing out.

By following three method you able to easily fix Maximum execution time exceeded error.

Method 1: Edit file wp-config.php :
To Increase Maximum Execution Time WordPress site Add the following line to wp-config.php:

#
set_time_limit(300)

Method 2: Edit .htaccess file at root directory :
Add the following syntax to .htaccess, Before edit Make sure you back up .htaccess for safety:

#
php_value max_execution_time 300

Method 3: Editing php.ini
Add the following to php.ini and upload it to root directory:

#
max_execution_time = 300

Method 4: Increase PHP Script Execution Time Limit Using ini_set()
Add this syntax at the top of your PHP script

#
ini_set('max_execution_time', 360); //360 is in seconds,

Method 5: To increase Php maximum execution time for specific Php file using .htaccess rule
Want to increase Php Maximum execution time for Specific .php file only instead of your entire host domain use below

# add following syntax in .htaccess and upload .htaccess file on same directory where your .php file reside


SetEnvIf Request_URI "your-php-file-name.php" DynamicTimeout=300


Leave a Comment

Scroll to Top