How to increase PHP Time Limit for WordPress sites?

What Is The PHP Time Limit?

The PHP Time Limit is the amount of time that your site will spend on a single operation before timing out. When an operation reaches the time limit set, then it will return a fatal error that looks like this:

Fatal error: Maximum execution time of xx seconds exceeded...

The default value for PHP time limit on most hosts for the PHP Time Limit is 30 seconds. You can increase this limit by following any of the the methods mentioned below.

1. Most Recommended: Just Contact Your Host
Increasing the PHP Time Limit is complex and the process that differs from hosts to hosts. So it is always better to get it done from someone who knows it well. So just get in touch with your hosting company and they will be happy to do it for you.

2. Increasing PHP Time Limit via PHP.ini file
Many small shared hosted servers do not allow users to access the PHP.ini file. If you are granted access, you can directly increase the PHP Time limit through this file. If you wish to extend the limit to 300 seconds, you can enter the following line of code or update if it exists already:

max_execution_time = 300;

3. Alternative to editing PHP.ini through wp-config.php
This is another alternative to the PHP.ini method. Simply add / edit the following line in the wp-config.php of your WordPress

set_time_limit(300);

4. Modifying the .htaccess file
Some of you might have the .htaccess file where you can simply add / edit this line of code to increase the time limit.

php_value max_execution_time 300

P.S: 300 in the above code samples mean 300 seconds. Feel free to change this to any appropriate number.