What is HTTP Error 500 in WordPress?

Do Errors End in WordPress?

Managing a WordPress website to run flawlessly all the time is like having a car that will never break down. Even with that, a lot of work is dedicated to carry out maintenance on the WordPress website so that there are no glitches. This is a by-default nature of WordPress because of it being an open-source technology which is prone to errors and those errors being resolved on a daily basis.

If you have been following our blogs religiously, you would have noticed by now that we focus on WordPress errors and its fixes. It is because the list of errors that occur in WordPress websites are endless. Well, this answers the question that we started off with!!

So, in lieu of our trend of blog topics, we will be discussing yet another error in this article and its fix.

One of the errors that are quite common in many WordPress websites is the “HTTP Error 500” amongst many others. This error occurs because of an internal server error. This means that when something goes missing or a technical mistake happens, your website’s server prompts you that something wrong has happened. As a result, whenever a visitor comes to your site, it displays the “HTTP Error 500” message causing trouble for both the WordPress website owners and visitors.
It’s a pretty straightforward error when it comes to defining it but fixing it altogether a different story. This is because finding the actual error is the difficult part as compared to the fix. We will try to discuss the fixes in the simplest possible way, but if anything is beyond your comprehension, just let us know, and we will get on your case.

So, let’s start with learning the fixes.

What are Four Possible and Effective Ways to Fix HTTP Error 500 in WordPress?

Things you Will Need

We have identified four possible methods that are quite effective when it comes to solving the ‘HTTP Error 500’ error. Before you start off fixing the HTTP Error 500 in WordPress using the any of the following 4 methods discussed, make sure that, you have these tools at your disposal to fix this error:

  1. Get root access to your server —- if you are using a VPS (Virtual Private Server) or a dedicated hosting.
  2. You need to have a FTP (File Transfer Protocol) client. You can pick clients i.e.Cyberduck or FileZilla to help you find quick fix for HTTP Error 500
  3. You will need a ‘text editor’ (though, it’s not necessary) but a suitable tool can come handy at the time of editing your code.
  4. You will also need to turn on debugging mode to correctly carry out this entire fixing procedure.

Once, you have these tools at the ready, it is time for you to start fixing HTTP error 500 in WordPress. We will begin with the easiest method of all.

Methods to Fix HTTP Error 500

1. Inspect your .htaccess file to locate errors

Find the error

.htaccess or Hypertext Access file is a server configuration file. This file lets you change server configurations for a particular directory. In most cases, this (.htaccess file) becomes too complicated to handle and it starts generating more technical issues.

There are four things that can make your .htaccess file corrupt. These are:

  1. Renaming your .htaccess file as .htaccess_backup
  2. Using FTP to access website’s files
  3. Finding .htaccess file, located in your root folder
  4. Checking .htaccess file carelessly which makes error persist

The Fix

If you’ve evaluated this situation critically, and have uncovered the root cause of your HTTP error 500 in WordPress — Kudos to you!! because a problem well-stated is half-solved. From here onwards, you can start fixing this technical issue using a few options, for example:

  • You can scrutinize your .htaccess line-by-line to find issues. Though, .htaccess files are not usually long, this might consume time. Indirectly, it can be risky as it can create new technical problems, if you’re not familiar with code, etc.
  • Another way to fix this issue is by resetting your .htaccess file. It’s a simple, easy-to-use method: just replace your file with the default code located in WordPress Codex and hurray — you’ve done it. But be careful: this method can remove any of the custom settings that you’ve added recently.

Good Trick: It’s better to use recent backup (if you have) to restore .htaccess file – this way you can reduce chances of losing potential data.

2. Expand your Site’s Memory

Find the error

WordPress websites have to deal with overwhelming amounts of data at times. If there is an insufficient amount of PHP memory space to run commands then the server is on the verge crashing – and, this will result in HTTP Error 500 in WordPress. Commonly, WordPress website hosts’ define a memory limit for the site and it happens due to various reasons. So, whenever, there is a spike in web traffic, there are possibilities that you’ll see this error.

The Fix

But you don’t need to become heart-broken as you can fix this issue using following trick:

Reach out to your website’s wp-config.php file through FTP, and then open it in a text editor, and type (‘WP_MEMORY_LIMIT’, ‘64M’) – you will see this command below (<?php)which is a tag on line 1:

In this step, save this file and re-upload it to your server, this practice will overwrite the original one.

Now check to see whether the error has gone. Fortunately, if the problem has been resolved, don’t forget to contact your host immediately for a permanent memory upgrade.

Keep-in-mind: This method (expanding your site’s memory) is a short-cut solution. You should use other methods as well mentioned on this list just to be sure that this error actually happened due to the short memory availability of your WordPress website.

Now, let’s move to the third method to know more about how to solve HTTP error 500.

3. Deactivate and then Reactivate Each Installed Plugin After Test

Finding the Error and The Fix

In case, if you are not sure that all methods discussed above are going to be helpful or not, then deactivating and then reactivating each installed plugin after a test, is a surefire way to fix HTTP Error 500. All you’ll have to do is to go to your admin dashboard, login and deactivate all of your plugins:

Unfortunately, if you’re not able to access your backend, you can access your website through FTP. Using FTP, you’ll have to look for the site’s plugins folder( within the wp-content directory), and rename this folder. Recheck the frontend of your site in this step. And, if you see that it works normal, then it means that the plugins were causing the HTTP Error 500.

Once inside the folder, you’ll have to rename each plugin before deactivation, so that it is easy for you to reactivate the original files. This practice of deactivating and reactivating each plugin after a test helps in locating the real culprit.

In the end, when you’ve detected the plugin causing the problem, you should hire an expert WordPress developer and look for a timely fix of HTTP Error 500. Possibly, you will have to replace or remove the plugin in order to avoid any future problems.

4. Go back to your Default WordPress Image Editor

Find the Error

This method is not widely popular when it comes to fixing HTTP Error 500 for WordPress sites because it is considered a temporary solution and not a permanent fix.

In WordPress, you’ll find two different image editors with its core installations: 1) Imagick; and 2) GD Library. Out of both these image editors, Imagick goes problematic to create HTTP error 500 for websites.

The Fix

In order to fix this, make the GD library as the default editor of your website. In order to do this, log into your website through FTP and search for the functions.php file. Usually, you’ll find this file within a folder of your active theme.

Go to your text editor, and add the following code right away:

				
					function wpb_image_editor_default_to_gd( $editors ) {
$gd_editor = 'WP_Image_Editor_GD';
$editors = array_diff( $editors, array( $gd_editor ) );
array_unshift( $editors, $gd_editor );
return $editors;
}
add_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd' );

				
			

At this stage, save and re-upload the function.php file. It is better to run a child theme, because all changes and modifications will be overwritten when you’ll update your theme.

Now, check frontend of your website again and assess how it looks.

Is the HTTP Error 500 Fixed for You?

The despair of discovering errors in WordPress sites, especially when it is generating revenue for your business can be quite overwhelming. With errors like ‘HTTP Error 500’, WordPress site becomes nightmarish because it wreaks havoc as it restricts access to your frontend.

A systematic and mature approach towards fixing this error message is indispensable as discussed in this article. However these fixes don’t guarantee 100% results because these are temporary solutions, therefore, it is good to talk to WordPress maintenance service company to help you with the continuous maintenance of your WordPress website to ensure it is running perfectly all the time.

‘Share your WordPress problems with us and we’ll fix it’