fatal error in wordpress

How to Fix Fatal Error in WordPress: Maximum Execution Time Exceeded in WordPress

Are you seeing the error like “Fatal error: Maximum execution time of 30 seconds exceeded” on your screen? The fatal error in WordPress is caused when you trying to update a WordPress plugin or theme.

Don’t be panic, in this article I am going to show you the easiest way how to fix the fatal error: maximum execution time exceeded in WordPress.

Why Fatal Error in WordPress is occurring?

WordPress is coded in the PHP programing language. There is a period limit set for how long a PHP script can run.

Most of the time the maximum execution time is set between 30- 60 seconds because that’s usually enough for a good PHP script to run.

When a PHP script reaches the maximum execution time limit, it results in maximum execution time exceeded error.

fatal error in wordpress

Fixing Maximum Execution Time Exceeded Error

Actually, the “Maximum Execution Time Exceeded” error is named a fatal error. This fatal error in WordPress is one of the most common WordPress errors and you can easily fix this error by using the following methods below.

When you seeing a fatal error in the WordPress site, WordPress may show the following error message to your website visitors.

fatal error in wordpress

Here I am going to share with you five different methods, which can solve your error successfully:

Method 1. Edit your .htaccess file

To fix the fatal error in WordPress you need to manually edit your .htaccess file and add a simple line of code.

To edit this code, you need to connect to your WordPress website using an FTP client. Go to your site’s root folder public_html.

In this folder, you will see wp-admin, wp-content, and wp-includes folders inside it. Your .htaccess file resides in the same folder.

fatal error in wordpress

Once you locate the .htaccess file select the file, right-click and click on the “View/Edit” option. This will open with a text editor.

And you need to add this line at the bottom of your .htaccess file

php_value max_execution_time 300

fatal error in wordpress

After adding this code, save your file.

This code set the value for maximum execution time to 300 seconds. You can now visit your site to see the error is resolved.

If you still get the fatal error in your site, then try to increase the value to 600.

Method 2. Create php.ini file

The php.ini file is a configuration file, which is defined settings for PHP on your server. On many hosting servers, you may not see it inside your WordPress folder.

In that case, you can create a new php.ini file inside your root folder. After that edit the php.ini file and add the following line.

max_execution_time = 60

After adding this line save and upload your changes back to the server. You can now visit your site and see the error is gone.

Method 3.Check for Corrupted WordPress plugin files

Sometimes your WordPress plugin an issue for fatal error on your website. You can easily find out if you have any corrupted plugins.

Go to your WordPress dashboard click on the Appearance button. Then click on the Plugins button.

fatal error in wordpress

You can see the all-installed plugin page and then you should deactivate the plugin one by one. Once you will find which plugin was corrupted, you should delete that corrupted plugin and reinstall that plugin from the WordPress directory.

If you don’t have access to the admin area of your WordPress site, then you will need to use your FTP Client.

Using your FTP Client

You need to connect your FRP client with the File Manager option in your WordPress hosting control panel.

Once connected, you need to find the public_html folder and open it. You can see the wp-admin, wp-content, and wp-includes folder.

fatal error in wordpress

Click on the wp-content folder, you will see a folder called plugins. All your installed plugins are stores in this folder.

fatal error in wordpress

Now you need to right-click on the plugin folder and rename this folder as ‘plugins_dactivate’. For doing this all of your installed plugins will be deactivated.

Using cPanel

If you can not use the FTP client, you can use your cPanel dashboard. for doing this, log in to your cPanel dashboard and click on the File Manager menu, move to the root folder like public_html file.

fatal error in wordpress

 

Click on the wp-content file, you can see two files like plugin and themes file. Now you should change the plugin file name (like- plugins disable). This will disable all your installed plugins.

If the Fatal error is gone, it means one of your active plugins was the culprit.

To find out which one, you can do this one by one renaming the plugin file name then return the plugins folder to its original name. Changing its name each time, then checking to see if the fatal error goes away. Keep disabling plugins one by one until you fix the problem like a fatal error.

If your website is now loading fine, you have found the troublemaker. Now, you can fix the problem by reinstalling that corrupted plugin from the WordPress directory.

If none of your plugins are causing problems, it’s time to turn towards your active theme.

Method 4.Check for Corrupted WordPress theme files

Sometimes your WordPress theme an issue for fatal error on your website. You can easily find out if your theme is corrupted. You can be switching to a default WordPress theme like Twenty Nineteen or Twenty-Twenty.

Go to your WordPress dashboard click on the Appearance button. Then click on the Themes button.

error establishing database connection

You can see the all-installed theme page and then click on the Activate button of the default theme like Twenty Nineteen or Twenty-Twenty.

If you don’t have access to the admin area of your WordPress site, then you will need to use your FTP Client to switch the theme.

Using your FTP Client

You need to connect your FRP client with the File Manager option in your WordPress hosting control panel.

Once connected, you need to find the public_html folder and open it. You will see the wp-admin, wp-content, and wp-includes folder.

 

Inside the wp-content folder, you will see a folder called themes. All your installed themes are stores in this folder.

Now you need to right-click on the themes folder and rename this folder as ‘themes _dactivate’. For doing this your installed themes will be deactivated.

WordPress will automatically activate the default theme like Twenty Fifteen or Twenty Sixteen.

Using cPanel

You can check your corrupted theme by cPanel. To do this log in to your cPanel dashboard and go to the File Manager menu, move to the root folder like public_html file. Click on the wp-content folder, you can see there are two files like plugin and themes file.

Now you can change the theme file name (like themes_deactivate). For doing this WordPress will revert to one of its default themes like Twenty Fifteen or Twenty Sixteen.

If your website is now loading fine, you can fix the problem by reinstalling the theme from the WordPress directory.

Method 5. Contact your Hosting Provider

If all methods fail to fix fatal errors in WordPress on your website. It may be a genuine server issue.

Contact your web hosting support team. They will be able to check the server logs and locate the root cause of the error.

Conclusion

I hope this article helped you to fix the error like fatal error: Maximum execution time exceeded in WordPress.

You may also want to see How to fix Error Establishing a Database Connection in WordPress, How to Fix “Briefly Unavailable for Scheduled Maintenance” Error in WordPress, and How to Fix 500 Internal Server Error in Your WordPress

If you like this article, then please share it with your friends.

Leave a Reply