fbpx

3 Ways to Fix a WordPress Fatal Error

A WordPress fatal error may sound scary, but don’t let the name fool you: your website is not actually dead.

However, a WordPress fatal error means that something in the code is stopping the site from loading properly. And in most cases, this problem isn’t going to solve itself. You need to identify what’s causing it and resolve it – otherwise, your site will never come back.

Depending on the cause, there are a few ways to fix a WordPress fatal error. Below, we post some basic steps for troubleshooting the issue, but if you’re new to WordPress or not comfortable making these changes yourself, we strongly recommend seeking the help of a WordPress expert.

 

SOLVED: WordPress Fatal Error

1) Increase your PHP memory limit

The most common reason for a WordPress fatal error is when your website exceeds your PHP memory limit. This error usually looks something like this:

Fatal error: Allowed memory size of 30544231 bytes exhausted

Your PHP memory limit is the maximum amount of server memory that each PHP script is allowed to consume. If your website theme, or a plugin, requires more memory than this limit, then it can trigger the WordPress fatal error.

So, the first thing you’ll want to do is double-check your PHP memory limit by logging into your WordPress dashboard and going to Tools > Site Health > Info > Server. If your PHP memory limit is less than 128MB, then you probably need to increase it. (More intensive themes and plugins, which involve multiple current server requests, may actually require much more than that.)

Unless you’re using your own dedicated web server, you will likely need to contact your hosting provider to increase the PHP memory limit for you. In some cases, this will involve editing your php.ini file, either via FTP or your website’s cPanel. Note, however, that not all web hosts allow access to this file by default, in which case you’ll want to contact them for further instructions.

2) Deactivate any new or updated plugins

If you received a WordPress fatal error after adding a new plugin, or updating an existing one, then this is a surefire sign that the plugin is causing the problem. These errors may include messages such as:

  • Fatal error: Incompatible file format
  • Fatal error: Uncaught error
  • Fatal error: Call to undefined function
  • Fatal error: Cannot redeclare

     

The solution is to deactivate and/or uninstall the bad plugin. If you have access to your WordPress dashboard, start by deactivating the plugin you recently installed or updated, and see if that resolves the problem. If not, repeat this step for all other plugins until the site loads properly again.

If the WordPress fatal error is stopping you from logging into your dashboard, then you’ll need to use an FTP client. Go to the /wp-content/plugins directory and rename it to something like plugins_old. This will deactivate all your plugins, which will hopefully enable your site to load again (though it may look different for now). You can then go to your dashboard to begin individually testing each one.

3) Update, restore or replace your WordPress theme

In addition to plugins, your theme can also be causing the WordPress fatal error.

The first thing to do is make sure your WordPress is updated to the latest version (Dashboard > Updates). See if that alone removes the error. If not, proceed to updating your WordPress theme to the latest version (Dashboard > Updates). 

Did the fatal error occur after you updated your theme? If so, then the update is likely not compatible with your current version of WordPress. One thing to try is downgrading your theme to the previous version. However, this capability is not built into WordPress itself. Some themes may have a feature that allows you to do it, but otherwise, you’ll either need to restore it from a backup or manually edit the theme folders via FTP and then upload an older version of your theme in your Dashboard > Appearance > Themes. 

  • Tip: Do each step one at a time, refreshing your site between each one to see if the error is still there. This will allow you to pinpoint the exact cause of the problem.

We Can Fix Your WordPress Fatal Error

WP Tangerine offers unlimited WordPress help, design, development, WordPress SEO services and more. If your site has a WordPress fatal error, or any other issues, get the help you need to restore your site back to normal and prevent problems from occurring again in the future.