How To Fix WordPress Fatal Errors

Are you experiencing “Fatal Error” messages in WordPress? Here are some of the more common WordPress fatal errors you may come across and how to fix these …

How To Fix WordPress Fatal ErrorsThis tutorial is part of our FREE WordPress Management training and WordPress Troubleshooting tutorial series.

In this series of step-by-step tutorials, we show you how to troubleshoot and fix common WordPress errors.

Useful Information

Important: Always back up your WordPress site (files and database) before modifying any files or performing any upgrades or installations! 

If you don’t want to do site backups, then consider using the services of a professional, or use a backup plugin.

How To Fix WordPress Fatal Errors

Issues with WordPress can result in a number of “fatal error” messages being displayed on your screen. Here are some of the more common WordPress fatal errors you may come across and how to fix these:

Fatal Error: Issue With A Plugin

Typically, if an error occurs within a plugin, such as a conflict between an outdated plugin becoming incompatible with a newer version of WordPress for example, you may get a “Fatal Error” message that can affect your entire site …

Fatal Error Message

In the example below, the ‘Fatal error’ clearly indicates that the error is caused by an incompatible plugin, and it also tells you which plugin is causing the error …

Fatal Error Message

To fix this error, all you need to do is deactivate the offending plugin.

To deactivate the plugin, log into your server using FTP or cPanel and locate your WordPress installation’s plugin folder. For this example, we’ll deactivate the plugin using cPanel’s File Manager.

Find the plugin that is causing the error, then select the plugin folder and click rename (if using cPanel’s File Manager – if using FTP, right-click on the file and select ‘Rename’) …

Fatal Error Message

Rename the file by adding anything after the plugin folder name (e.g. ‘old’) and click on ‘Rename File’ …

Fatal Error Message

Confirm that the plugin has been renamed and exit cPanel (or FTP) …

cPanel File Manager

Go back to your browser and refresh or revisit your website’s page. Your site should be restored to normal …

Fatal Error Message

If you log into your site, you may see a message informing you that the plugin has been deactivated due to an error and that the plugin file no longer exists. Refresh your page to dismiss the error message …

Fatal Error Message

Now that you have restored your site to normal, delete the plugin from your site and notify the plugin developer of the error. Hopefully, they will address the problem and issue a new update with a solution.

If you have multiple WordPress sites using the same plugin, remember to check them all to make sure that they are still up and running.

To learn more about errors caused by plugins and how to fix these, go here:

Fatal Error: Call to undefined function

This error means that a plugin or a theme is expecting to find something that isn’t there – hence the undefined function. It could happen for a number of reasons:

  • An error during auto-upgrade. If this happens you should upgrade manually.
  • An error during auto-install. Again, if this happens reinstall manually.
  • A plugin or theme is incompatible with your version of WordPress. This usually happens with older versions of WordPress and new plugins. It may also be that you’re trying to install a plugin that is only compatible with a certain type of setup (e.g. Multisite). If it happens while installing a plugin, disable the plugin using FTP.

To learn more about using FTP and transferring files between your computer and your server, go here:

Fatal Error: Allowed Memory size exhausted

Fatal error: Allowed memory size exhausted

(Fatal error: Allowed memory size exhausted)

This error occurs when the amount of memory allocated to WordPress isn’t enough to perform the task required by a feature or plugin that you have installed on your site. Web hosting companies typically set a server limit for PHP memory to one of the following amounts: 32, 64, 128, 256, or 512 MB.

Note: Exceeding your PHP memory limit can also lead to a 500 Internal Server Error.

To fix this error you need to increase the amount of memory that WordPress can use. To do this you will need to either edit your wp-config.php file or your php.ini file.

Edit wp-config.php File

The wp-config.php file is located in your WordPress installation directory and can be accessed via FTP or using cPanel’s File Manager …

wp-config.php file

(wp-config.php file)

If you need help accessing files on your server, see this tutorial:

To edit wp-config.php, download the file to your hard drive, then open up the file using a plain text editor and add the following line:

WordPress Troubleshooting… or change the current setting to a higher limit (e.g. ‘256’ or ‘512’) …

Increase memory limit in your wp-config.php file

(Increase memory limit in your wp-config.php file)

After editing and resaving your wp-config.php file, reupload the file to your server overwriting the existing file.

Edit php.ini File

Editing your php.ini file is a bit more complicated as it’s not a file that comes with WordPress but is part of your hosting account.

A php.ini file is the default file for configuring and running applications that require PHP. The server looks for this file when PHP starts up for instructions on how to control variables such as upload sizes, file timeouts, and resource limits.

If your server contains a php.ini file, you can access it using FTP or cPanel’s File Manager …

php.ini

(php.ini)

Download a copy of your php.ini file to your hard drive, then open it using a plain text editor …

Open your php.ini file using a plain text editor

(Open your php.ini file using a plain text editor)

Note: To locate and open the php.ini file in your plain text editor, make sure that ‘All files (*.*)’ is selected in the ‘Files of type:’ drop-down menu.

This file should contain a simple instruction for setting the PHP memory limit …

PHP memory limit

(PHP memory limit)

Increase the memory limit amount (e.g. from 64M to 128M or 256M) …

Increase PHP memory limit amount

(Increase PHP memory limit amount)

Resave the php.ini file and reupload the file to your server overwriting the existing file.

If you don’t have access to your php.ini file, contact your hosting provider to make changes, or see this tutorial:

You may also want to try adding the line of code below to your .htaccess file and see if this fixes the problem:

Troubleshootimg WordPress

Fatal error: Maximum execution time

Open up your wp-config.php file and add the following line:

set_time_limit(0);

You can add the line shown above anywhere in the file, even right after the opening comment block, as shown in the example below:

WordPress Troubleshooting Tutorials

After making the adjustment, retry the automatic update.

How To Fix WordPress Errors – Videos

In addition to the information above, here are a couple of videos on how to fix WordPress “fatal” errors from the team at MyThemeShop:

How To Fix WordPress Memory Exhausted Error

(How to fix WordPress memory exhausted error. Video: MyThemeShop)

How To Fix WordPress Fatal Error: Maximum Execution Time Exceeded

(How to fix WordPress fatal error: Maximum execution time exceeded. Video: MyThemeShop)

More WordPress Troubleshooting Tutorials

Please see the tutorials in the section below if you experience any other issues with WordPress:

How To Fix WordPress Fatal Errors

(Source: Pixabay)

***

"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie

***

Recommended Video Courses For WordPress Users

How To Set Up WordPress On LocalhostHow To Set Up WordPress On Localhost

Learn how to install, set up, and locally host a fully functioning WordPress site on your computer.

More info: How To Set Up WordPress On Localhost

Recommended Video Courses For WordPress Users

How To Use cPanelHow To Use cPanel

cPanel is a powerful and simple-to-use web hosting management software application that gives website owners the ability to quickly and easily manage their servers and websites using a simple and intuitive dashboard.

This video course will teach you how to use the main features of cPanel to manage your web hosting.

More info: How To Use cPanel

Recommended Video Courses For WordPress Users

How To Use Amazon S3How To Use Amazon S3

Learn how to set up and use Amazon S3 to upload, store, manage, and protect your site’s images, large media files, downloadable files, stream videos and more.

More info: How To Use Amazon S3

Recommended Video Courses For WordPress Users

Using Password ManagersUsing Password Managers

Password Managers provide an easy and secure way to keep track of all your passwords. This video course shows you how to use two FREE powerful password management tools.

More info: Using Password Managers

Recommended Video Courses For WordPress Users

How To Set Up A Forum On WordPressHow To Set Up A Forum On WordPress

Learn how to set up a forum for your visitors, prospects, customers, members, or affiliates using WordPress.

More info: How To Set Up A Forum On WordPress

Recommended Video Courses For WordPress Users

How To Optimize WordPressHow To Optimize WordPress

Learn how to optimize your WordPress site and improve your page loading speed.

More info: How To Optimize WordPress

Recommended Video Courses For WordPress Users

How To Back Up & Restore WordPress SitesHow To Back Up & Restore WordPress Sites

Learn how to safely and automatically backup your WordPress files and database and how to easily restore your WordPress site if something were to happen.

More info: How To Back Up & Restore WordPress Sites

Recommended Video Courses For WordPress Users

Google ToolsGoogle Tools

This video course will help you learn the basics of using Google Tools like Google Analytics and Gmail.

More info: Google Tools

Recommended Video Courses For WordPress Users

How To Install, Set Up & Use WordPress MultisiteHow To Install, Set Up & Use WordPress Multisite

Learn how to quickly and securely set up an online community of websites or blogs using the powerful WordPress Multisite feature.

More info: WordPress Multisite

Recommended Video Courses For WordPress Users

WordPress SecurityWordPress Security

Learn how to keep your WordPress site or blog secure and protected from malware, hackers and brute-force attacks.

More info: WordPress Security

Author: Martin Aranovitch

Martin Aranovitch is the founder of WPCompendium.org and the author of The Small Business Digital Manager. WPCompendium.org provides hundreds of FREE tutorials that show you how to use WordPress to grow your business online with no coding skills required! Get our FREE "101+ WordPress Tips, Tricks & Hacks For Non-Techies" e-course with loads of useful WordPress tips!

Originally published as How To Fix WordPress Fatal Errors.