The ‘Fatal error: Maximum execution time of 30 seconds exceeded’ is one annoying error many WordPress users have faced in the past and will most likely still face in future. This type of error shows up mostly when one is trying to update or install a WordPress theme or plugin.
Why Maximum Execution Time Exceeded Error Occurs?
Typically this problem occurs when a PHP code in WordPress takes a long time to run and reaches the maximum time limit set by your WordPress hosting server. This time limit is important because it helps prevent the abuse of server resources.
The actual time limit varies across hosting companies, however most of the times the maximum execution time is set between 30 – 60 seconds because that’s usually enough for a good PHP script to run.
When a script reaches the maximum execution time limit, it results in maximum execution time exceeded error.
Fixing Maximum Execution Time Exceeded Error
Although Maximum Execution Time Exceeded error is named a ‘fatal error,’ it is one of the most common WordPress errors, and you can easily resolve this.
To fix the error, you will need to manually edit your .htaccess file and add a simple line of code just as shown in the guide below.
- Login to your hosting dashboard and locate the .htaccess file. This is usually found below the wp-includes folder for your WordPress installation files.
- Once you locate the .htaccess file, right-click and open ‘View/Edit’ option. This will open the file for editing.
- Next, you need to add the line of code below inside your .htaccess file at the position specified:
This code simply sets the value for maximum execution time to 300 seconds (5 minutes). You can now visit your website to see if the error is resolved.
If you still get the error, then try increasing the value to 600.
- Once done, save your file.
If you found this guide useful, then check out these most useful .htaccess tricks for WordPress.