Max Execution Time Error in WordPress is a common issue encountered by WordPress users, especially those with resource-intensive websites or those making significant changes. This error occurs when a script runs longer than the allowed time set by the server, leading to incomplete processes and potential site disruptions. Fortunately, there are several ways to fix this error. This comprehensive guide will cover six effective methods to increase the max execution time in WordPress, ensuring your site runs smoothly.
Table of Contents
Understanding the Max Execution Time Error
The Max Execution Time error is a server-side issue where a PHP script exceeds the maximum time limit set by your server. PHP is the scripting language used by WordPress, and each server has a maximum time limit set to prevent server resources from being overused by long-running scripts. When a script exceeds this limit, you see an error message like:

How To Fix The Max Execution Time
Method 1: Editing the .htaccess File
One of the simplest ways to increase the max execution time is by editing the .htaccess file. This file is located in the root directory of your WordPress installation and controls various server settings.
Steps to Edit the .htaccess File:
- Access Your Server: Use an FTP client or your hosting provider’s file manager to access your WordPress files.
- Locate the
.htaccessFile: This file is in the root directory, typically/public_html/or/www/. - Backup the
.htaccessFile: Before making any changes, create a backup of this file. - Edit the File: Add the following line at the end of the
.htaccessfile:
php_value max_execution_time 300
This code sets the maximum execution time to 300 seconds (5 minutes). You can adjust the number according to your needs.
- Save and Upload: Save the changes and upload the file back to your server.
Method 2: Modifying the php.ini File
The php.ini file is the configuration file for PHP. If you have access to this file, you can directly increase the max execution time.
Steps to Modify the php.ini File:
- Access Your Server: Use an FTP client or your hosting provider’s file manager.
- Locate the
php.iniFile: This file is usually found in the root directory or in a folder namedetc. - Create or Edit the File: If you don’t see a
php.inifile, create a new one. Add or modify the following line:
max_execution_time = 300
This sets the maximum execution time to 300 seconds.
- Save and Upload: Save the changes and upload the file back to your server.
Method 3: Increasing Time via wp-config.php
The wp-config.php file is another important configuration file in WordPress. You can increase the max execution time by adding a line of code here.
Steps to Edit the wp-config.php File:

- Access Your Server: Use an FTP client or your hosting provider’s file manager.
- Locate the
wp-config.phpFile: This file is in the root directory of your WordPress installation. - Backup the
wp-config.phpFile: Create a backup before making any changes. - Edit the File: Add the following line before the
/* That's all, stop editing! Happy publishing. */comment:
set_time_limit(300);
This line sets the max execution time to 300 seconds.
- Save and Upload: Save the changes and upload the file back to your server.
Method 4: Using a WordPress Plugin
If you’re not comfortable editing files directly, you can use a WordPress plugin to increase the max execution time.
Recommended Plugins:
- WP Maximum Execution Time Exceeded: This plugin automatically increases the max execution time.
- WP Hosting Performance Check: This plugin allows you to view and change your server settings, including the max execution time.
Steps to Use a Plugin:
- Install and Activate the Plugin: Go to your WordPress dashboard, navigate to Plugins > Add New, search for the plugin, and click Install Now. Then, activate the plugin.
- Configure the Plugin: Follow the plugin’s instructions to increase the max execution time.
Method 5: Contacting Your Hosting Provider
If you’re on a shared hosting plan or if you don’t have access to the necessary files, contacting your hosting provider might be the best option. Many hosting providers are willing to increase the max execution time upon request.
Steps to Contact Your Hosting Provider:
- Find Support Contact Information: Look for your hosting provider’s support email, live chat, or phone number.
- Explain the Issue: Describe the Max Execution Time error and request an increase in the max execution time.
- Follow Their Instructions: Your hosting provider may ask for specific details or may make the change for you.
Method 6: Optimizing Your WordPress Site
Sometimes, the best way to deal with the Max Execution Time error is to optimize your WordPress site, reducing the need for longer execution times.
Tips for Optimizing Your WordPress Site:
- Optimize Images: Use plugins like Smush or ShortPixel to compress and optimize images.
- Minimize Plugins: Deactivate and delete unnecessary plugins to reduce load times.
- Enable Caching: Use caching plugins like W3 Total Cache or WP Super Cache to improve performance.
- Update WordPress: Keep WordPress, themes, and plugins updated to the latest versions.
- Use a CDN: Content Delivery Networks (CDNs) can significantly reduce load times.
Conclusion
The Max Execution Time error in WordPress can be frustrating, but it’s manageable with the right approach. Whether you choose to edit files directly, use a plugin, or optimize your site, increasing the max execution time is a crucial step in ensuring your WordPress site runs smoothly. By following the methods outlined in this guide, you can effectively resolve this issue and prevent future disruptions.