Troubleshooting Common WordPress Errors

WordPress is a unique application. It lets users build a blog or website quickly and easily. It’s very customizable with many different themes and plugins available. Unfortunately it does have some faults and when it stops working it can be difficult to know what to do. This guide will cover the most common WordPress errors and how to resolve them.

The White Screen of Death

The white screen of death is exactly as it sounds. You’ll attempt to access the WordPress Dashboard or worse, your WordPress website and the screen will be blank.

There are a number of things that can cause the white screen of death, from conflicting plugins to exceeded memory limits. If there’s no error message indicating where the trouble lies, work through this troubleshooting process.

Step 1. Deactivate All Plugins

If only your site is down and you still have access to the WordPress Dashboard do the following.

Go to Plugins > Installed Plugins

Installed Plugins

Select all plugins and from the Bulk Actions menu, select Deactivate and then click Apply

Your plugins will now be deactivated.

If you don’t have access to the Dashboard you’ll need to deactivate the plugins manually. This can be done through the cPanel File Manager.

The plugins folder is contained within the wp-content directory. You’ll want to rename the plugins folder to something like plugins_deactivated This will deactivate all plugins on your site.

With the plugins deactivated, it’s time to see if your site is working now. If you have access again, you know that the issue was likely a plugin. This means that one of your plugins conflicts with your theme or another plugin.

Step 2. Find the Problematic Plugin

You now need to figure out which plugin is at fault. To do this, you must activate your plugins one at a time.

Starting at the top of your list, activate the first plugin.

If this plugin is the cause, then you should lose access to the WordPress Dashboard or your website again. (You can restore it once more by deactivating the plugin.)

If you don’t see the white screen of death, deactivate this plugin and try the next one. You’ll have to repeat these steps until you locate the problematic plugin.

Once you’ve identified the plugin causing trouble, go ahead and reactivate all of the other plugins on your website.

You’ll want to reach out to the plugin developer to report the issue. Make sure you have screenshots of the error and can describe in detail why it happened and how you were able to confirm it.

Step 3. Try a New Theme

If you still see the white screen of death after deactivating all of your plugins, then your theme may be the culprit.

To confirm this you need to deactivate your current theme.

If you still have access to the WordPress Dashboard and it’s only your site that’s down, do the following.

Go to Appearance > Themes

Themes

In order to deactivate your theme, you have to activate a different one.

Whether it’s already installed or not, activate the latest WordPress default theme.

If you don’t have access to the WordPress admin, do the same thing you did with your plugins from the control panel.

Again, find the wp-content folder. This time, you’ll want to look for the themes folder inside it and rename it to themes_deactivated This will deactivate your theme and automatically activate the default WordPress theme.

You can now check your site to see if the white screen of death is gone. If it is, then you know that the issue is a conflict with your theme.

Contact the theme developer with screenshots of the error and a description of the steps you took to confirm the issue.

Internal Server Error (error code 500)

It’s not always 100% clear what caused the 500 internal server error. However with the following troubleshooting steps we can narrow down the reason.

Step 1. Replace .htaccess File

The first thing to test is the .htaccess file. It can occasionally become corrupted and cause your site to be replaced by an “Internal Server Error” page.

Through the cPanel File Manager activate the option to Show Hidden Files. This is done by clicking Settings in the upper right corner.

Settings

You’ll need to select Show Hidden File (dotfiles) and click Save

Show Hidden Files

Rename the .htaccess file to deactivate it.

Go to your site and see if that removed the internal server error. If it did, then all you need to do is create a brand new file.

In the cPanel File Manager click File on the left side.

Create New File

Name the file .htaccess and click Create New File

Next you’ll want to select the newly created .htaccess file and click Edit. The following code can be entered and saved. This creates a brand new .htaccess file.

Screen Shot 2020-09-13 at 2.53.42 PM

Step 2. The White Screen of Death Fix

Run through the white screen of death troubleshooting steps.

If the error still exists after this, try the next step.

Step 3. Increase the Memory Limit

Go to your file manager and open the wp-config.php file.

At the bottom of the file, look for a string that looks like this…

define( 'WP_MEMORY_LIMIT', '64M' );

It’s the “64M” bit that needs to be updated. To give your server more memory to process your request, increase the limit to 256M

define( 'WP_MEMORY_LIMIT', '256M' );

Step 4. Replace the wp-admin and wp-includes Folders

An update may have unintentionally corrupted the code in your wp-admin or wp-includes folders.

At this stage it’s best to reinstall the WordPress core files. If you have access to the Dashboard, it’s possible to reinstall from there.

Access your Dash board and select Updates on the left side and then click on Re-install Now

If you don’t have access to the Dashboard, you’ll need to reinstall the core files manually using our guide Replacing WordPress Core Files

Error Establishing Database Connection

When you see this error message, it means that something is keeping your WordPress site from connecting to its database.

Check the wp-config.php File

The wp-config.php file contains details about how your website is configured — including your database information. Check this first before trying any other fixes.

Go to your cPanel File manager and make your way to the wp-config.php file. Open it for editing.

You should find a section dedicated to your database settings. It’ll look like this…

If any of this data is missing or looks incorrect, make the necessary changes saving them and then checking the site to see if the database connection has been restored.

Critical Error On Your Website

If your site doesn’t load but instead shows a critical error, looking in the error log can be helpful in determining what the cause is.

In the root level or your WordPress installation will be a file called error_log You can open this through the cPanel File Manager and view the contents.

error_log

Scrolling to the end will show the most recent entry.

As an example…

[16-Sep-2020 19:33:14 UTC] PHP Parse error: syntax error, unexpected ‘|’, expecting variable (T_VARIABLE) in /home/cpanel_user/wp-content/plugins/google-calendar events/vendor/nesbot/carbon/src/Carbon/Traits/Date.php on line 1032

This points to the plugin Google Calendar Events /wp-content/plugins/google-calendar-events

You can deactivate the plugin by following the directions above either through the Dashboard if access is still available or by renaming the corresponding plugin directory.