My bullet-proof process for troubleshooting any WordPress issue

Hire a WordPress Expert on Codeable
Updated On: May 3, 2023 0 Comments

I follow the exact same process whenever I troubleshoot my client websites.

WordPress Critical Error

Step 1: Create a staging site if it doesn’t exist or update an existing one

When we create a new staging site, it will be an exact replica of our live website. We don’t have to worry in this case.

But if the staging site already exists, we have to make sure that it is up to date with the live site.

If the staging site is not up to date, we can’t troubleshoot accurately because the problem might not exist in the staging environment.

If your site doesn’t have a staging feature at all, then trust me, it is a good idea to move to a web host that has a staging feature inbuilt.

It will save you a lot of time and money in the long run.

According to my experience, WPEngine has the best staging site functionality.

Step 2: Enable debugging mode in WordPress

The next step is to enable debugging for your staging site.

To do this, find the wp-config.php file of your staging website.

Then turn on debugging by setting the wp_debug setting to true:

define("wp_debug", true);

By default, it will be set up as false.

WP Debug setting inside the WordPress configuration file

Perform this step only if you know what you are doing.

If you mess up the code syntax, you’ll get a fatal error.

But it’s okay because it is a staging site 😛

Step 3: Finding the traces of the problem

After turning on the debug mode, go ahead and refresh the browser again.

This time you’ll see a detailed error message stating what went wrong.

Now look for the words “plugins” or “themes” inside the error message.

If they are found, you can easily see which plugin or theme caused the problem and then take the necessary action.

If it is a theme, you will definitely find its name inside the error message along with the file name and the line number where the error occurred.

If the problem is with the plugin, the action could be turning off a particular setting inside the plugin or deactivating it altogether.

Anyway, if the problem is with a particular plugin, sometimes you can not see its name.

In that case…

Step 4: Start deactivating the plugins one by one

If the root of the problem is unclear, start deactivating the plugins one by one and see if the error is gone.

In most cases, deactivating a certain plugin will fix the issue.

If you don’t have access to the admin dashboard, then use FTP to deactivate the plugins one by one.

For deactivating a particular plugin via FTP, you just need to rename the plugin folder to something different from the original.

I usually add an underscore (_) in front of the plugin folder name.

For example, if the plugin folder name is far-future-expiry then I would rename it to _far-future-expiry

If you are not familiar with what FTP means, read my article here.

Step 5: Switch to a default theme

Sometimes, the problem could be with a compatibility issue between a theme and a plugin.

For this kind of problem is impossible to find whether the problem is with the theme or the plugin.

For cases like this, switching to a default theme will fix the issue. It happened to me a lot of times.

If the issue got resolved after switching to a default theme, then the problem is a compatibility issue between the active theme and a plugin.

We can’t tell who is at fault because it is impossible for a plugin developer to support every theme out there in the market.

This applies to theme developers as well. They can’t support all the plugins in the market.

The blame game is quite often in this scenario.

Step 6: Remove the error on the live site

Now, let’s just say you figured out the problem and it got resolved after deactivating a plugin or switching to a default theme.

Apply the same thing on the live site so that your visitors don’t see the ugly error message.

After removing the error on the live, start can dig deeper into the problem and fix the issue permanently.

Step 7: Applying a permanent fix

Now that you know what kind of problem it is, depending on your skill set, you can try to fix the problem permanently.

The permanent fix could take many directions.

If the problem is with a custom theme, you’ll get it fixed by being a developer or by hiring a developer.

If the problem is with a third-party theme, then you will need to reach out to the developer asking him/her to fix the issue. This could take a lot of time.

If the problem is with a third-party plugin, then you have two options here:

  1. Finding and moving to an alternative plugin
  2. Reaching out to the developer asking to fix the issue.

If the problem is with the third-party theme or plugin, then don’t try to fix it by modifying them because you’ll lose those changes when you update them.

That’s all!

Leave a Reply

Your email address will not be published. Required fields are marked *