How to Fix the WordPress 500 Internal Server Error

How to Fix the WordPress 500 Internal Server Error 1 2020

500 Internal Server Error is a really common error message and can mean a number of things.

It’s a type of information that belongs to the category of the ‘HTTP status codes’, which basically provide you with information about the success of an online request.

If the online request is successful, everything flows smoothly, but if it’s not, you get a type of HTTP status code. In this case, that’s the 500 Internal Server Error. 

How to Fix the WordPress 500 Internal Server Error 5 2020

The problem is, these kinds of error messages are generic – they can be a bit vague, meaning you won’t always know where the problem lies and why that particular request wasn’t successful. And this is particularly true for the 500 Internal Server Error message.

This is a type of HTTP status code that gives you the info that during connection to the server, an error has occurred, which also means that the page requested cannot be accessed. But, it actually won’t tell you the full story or, in other words, it won’t tell you why this happened in the first place. 

This is a common problem and error so we decided to put together a short article and cover the basic info on why this might happen and what are the typical sources of these kinds of errors as well as how to do some basic troubleshooting.

1. Check the .htaccess File for Potential Errors

Errors in the htaccess file is the most common reason for “500” server errors.

This file is a key configuration file on Apache web servers which means the presence of even one simple, but wrong character in this file can crash your site immediately and cause the WordPress 500 Internal Server Error. 

A simple fast way to diagnose if this is the problem is to connect to the files of your site using either FTP or your web host’s control panel again or some sort of file manager.

Once you locate the file, rename it temporarily. If you find out that the site manages to load after the error message disappears, then this means that you’ve found the root cause.

Now that you know this is the root cause you can troubleshoot the .htaccess file directly. One way would be creating a new .htaccess file using the default configuration from WordPress.org here. Alternatively, digging through your renamed htaccess file and removing an unusual code would be the other way to do it – if you’re not a tech personal option 1 is going to be the better path here.

2. Ask your web host for support

So, as we said, the WordPress 500 Internal Server Error is a generic HTTP status code on the failure of server connection, and it can mean lots of things.

Sometimes the simplest path to a solution is to ask for help. Instead of messing around for hours the simplest solution might be to just hit up your web hosting support team and ask them to fix it for you.

If you’re not technical you could spend hours troubleshooting this issue and still not find a fix or worse, break your site or accidentally delete content permanently.

3. Check your plugins & theme

If it’s not your htaccess file that’s the problem and you don’t want to ask your host for help then next up would be to check the active plugins.

Quite commonly a poor plugin update or a new plugin installed can introduce this issue.

An easy quick first diagnostic step would be to rename the /wp-content/plugins folder to something like /wp-content/plugins-renamed using FTP or a file manager which essentially disables all the active plugins.

If this make the error go away then you know it’s a plugin problem, if the error persists then it’s not your plugins and wise to rename the folder back to the original /wp-content/plugins

If the plugins folder is the issue then creating a new /wp-content/plugins folder and moving each plugin back from /wp-content/plugins-renamed will allow you to check one by one which one is the issue.

In a similar way to your plugins, your theme could also be the cause of this issue but this is quite rare. Removing your theme folders from /wp-content/themes in a similar way to the plugins folder will disable the active theme BUT this is probably one of the last options to try given how rare this would be the issue.

3. Check your server log

99.9% of hosts will give you access to the Apache or web server logs. The error log or access will often tell you the root cause of the 500 error and allow you to trace it back to it’s source.

4. Check your functions.php file

functions.php is a file that usually sits in the same folder as your theme and most often where custom code is added. (More details on functions.php here at the WordPress codex)

This file functions in a similar way to a WordPress plugin so dodgy code and code with typos in the functions.php file can cause problems here. Usually the best approach is to remove custom code added to this file temporarily. If the error message disappears you know this is the root cause.

5. Check your wp-config.php file

wp-config.php *usually* sits in the root WordPress folder. It’s a configuration file that WordPress relies on to tell it where to find the database tables and other critical information about the site configuration. (More on wp.config.php here on the WordPress codex)

Again, bad code in here, typos and incorrect settings can cause problems. This file can be complex so troubleshooting settings in it is really outside the scope of this article but making sure there’s no typos in there and the quotes characters used (these: “code here”) to wrap settings are correct. Quite commonly when copying and pasting code from Notepad or other text editors these characters can be changed slightly and cause problems.

5. Delete the /wp-content/cache folder

If your WordPress site has been optimized for speed at all then you’ll likely be using caching plugins.

These plugins typically store their data in the /wp-content/cache folder and occasionally they can cache bad or corrupt data.

A simple way to clear this cache is just to rename or delete this folder. Renaming is usually faster so if you rename to /wp-content/cache-OLD or something like that it’ll immediately bypass any of this cached data. If this solves the problem then delete the cache-OLD folder when you get a moment.

If the problem happens again shortly after deleting this folder it could be a case where one of your caching plugins has an incorrect setting.

6. Check if the WordPress Core is Causing a Problem

It so happens to be that the core installation of your WordPress site is a potential place for issues connected to the 500 Internal Server Error. This can happen for different reasons. You may be missing some types of files, while others may simply be corrupted or changed. That’s why it’s a good idea to make sure there’s nothing wrong with your core WordPress installation, so you can rule it out as the culprit behind the 500 error message. 

Reinstalling the core of WordPress is kind of the nuclear option so probably wise to use these steps as a last resort AND do a backup first.

These steps are essentially the same process as a manual WordPress update as explained in more detail here.

Below you can see the steps you need to take to remove and re-install WordPress core files manually: 

  1. Download the latest WordPress zip (or tar.gz) file.
  2. Unpack the downloaded zip file.
  3. Deactivate the plugins.
  4. Delete the old wp-admin and wp-includes directories on your web host (you can do this through your shell access or through your FTP).
  5. Using your shell access or your FTP, proceed to upload the new wp-admin and wp-includes directories to your web host, putting them in place of the directories which were previously deleted.
  6. Upload the individual files from the new wp-content folder to your already existing wp-content folder, overwriting the existing files. NOTE: NEVER delete your existing wp-content folder. NEVER delete any files or folders in your existing wp-content directory (with the exception of the one that’s overwritten by new files).
  7. Upload all new loose files from the root directory of the new version to your existing WordPress root directory.

NOTE:  Make sure to replace all of the old WordPress files with the new ones in the wp-admin and wp-includes directories, as well as sub-directories, but also in the root directory (such as index.php, wp-login.php etc.). You won’t have to worry about your wp-config.php; it will remain completely safe.

Be careful and pay attention when you start to copy the wp-content directory. Note that you should only copy the files from inside this directory, rather than replacing your entire wp-content directory. This is practically where all your themes and plugins “live”, which means you’d definitely want to keep them. If you’ve made customization of the default or classic themes without changing their names, then make sure not to overwrite those files, because if you do, you will lose your changes. (If you want to compare them for new features or fixes, though, then that’s a different matter.)

Related Posts

The Fastest & Best WordPress Hosting

How to fix slow WordPress sites

Fastest Themes for WordPress

SiteSpeedBot Website Speed Test Tool

Comments are closed.