maximum execution time exceeded error in WordPress

The “Maximum Execution Time Exceeded” error occurs when a script on your WordPress website takes too long to execute. By default, most web servers limit the amount of time a script can run to prevent the system from slowing down or crashing.

maximum execution time exceeded error in WordPress

Reasons of “Maximum Execution Time Exceeded” error:

Here are the common reasons why this happens:

#1 Heavy Plugin or Theme Updates:

Updating heavy plugins or themes can take longer than the allowed execution time, triggering the error.

#2 Low PHP Execution Time Limit:

Most hosting providers set a default execution time (usually 30 seconds). If a process takes longer, you’ll face this error.

#3 Slow Hosting Environment:

If your hosting server is slow or underpowered, scripts may take longer to execute, leading to the error.

#4 Poorly Coded Plugins or Themes:

Some plugins or themes may contain inefficient code, causing prolonged execution time.

#5 File Uploads or Imports:

Uploading large media files or importing data can exceed the execution time.

Symptoms of Maximum Execution Time Exceeded Error

Recognizing the symptoms of this error can help you address the issue promptly. Here are some common signs that you are facing a “Maximum Execution Time Exceeded” error:

Error Message on the Website:

You may see an error message like “Fatal error: Maximum execution time of 30 seconds exceeded in /home/your-site/public_html/wp-includes/” on a blank screen.

White Screen of Death (WSOD):

In some cases, your website may stop loading altogether, showing a blank white screen.

Inability to Update Plugins or Themes:

The update process may freeze or fail to complete, displaying an execution time error.

Failure in Uploading Large Files:

When trying to upload a large image, video, or other media, the upload may stall or fail.

How to Fix Maximum Execution Time Exceeded Error

Now that you know the reasons and symptoms, let’s explore how to fix the error. A WordPress developer or web developer can use several methods to resolve this issue.

1. Edit the .htaccess File

  • Locate the .htaccess file in the root directory of your WordPress installation.
  • Add the following line to increase the execution time limit:
    Copy code
    php_value max_execution_time 300
  • Save the file and refresh your website to see if the error is resolved.

2. Modify php.ini File

  • Access the php.ini file in your WordPress directory (if available).
  • If there’s no php.ini file, you can create one and add the following line:
    Copy code
    max_execution_time = 300
  • Save the changes and restart your server if necessary.

3. Use a Plugin

If you’re uncomfortable editing files, you can use a plugin like WP Maximum Execution Time Exceeded or Increase Maximum Execution Time.
These plugins allow you to increase the execution time without directly editing your site files.

4. Contact Your Hosting Provider

Some hosting providers restrict the maximum execution time by default. In this case, contact your web hosting provider and request that they increase the time limit for your website.

5. Optimize Plugins and Themes

Deactivate unnecessary or poorly optimized plugins or themes that could be causing the issue.
Regularly update your plugins and themes to ensure they are optimized for performance.

6. Upgrade to Better Hosting

If you frequently encounter an error due to slow server response, consider upgrading to a more robust hosting plan. A web developer can help you choose a hosting provider that suits your website’s needs.

Conclusion
The “Maximum Execution Time Exceeded” error is common in WordPress, but with the right approach, it’s easy to fix.

Whether you’re a WordPress developer or webmaster, addressing execution time errors can significantly improve your website’s performance and user experience.

Our Development Skills