WordPress 500 Server Error

How to Fix 500 Internal Server Error WordPress?

What You'll Learn

There you are, you load up your website and you see the dreaded white screen.  Your site has an HTTP error 500 on WordPress.  What is that and how to fix 500 Internal Server Error WordPress?  What causes that?

What is a 500 Internal Server Error in WordPress

These errors can be a real pain.  The short of it is that your server is telling you that it has a problem that it can’t recover from.  A 500 internal error in WordPress tells us that our server has a big problem.  It could be a configuration file, a coding error or a problem with the server.  This can be as simple as a typo or as complicated as a big deal that will need a developer to fix.

You might see the error on every page, just the front-end pages that users see or on your admin dashboard.  Sometimes, knowing where it happens can help fix it.

Common Causes of a 500 Internal Server Error in WordPress

There are a number of reasons causing 500 internal server errors.

  • Low PHP memory limit – If PHP doesn’t have enough memory to run everything then it will just give up.  Often you can fix this by increasing the memory limit.  This would be a fairly common problem with a big site on a shared hosting set-up especially.
  • Corrupted configuration files – Your server and WordPress use a variety of configuration files to tell give it certain parameters. For example, this is how WordPress knows the database access values like username and password.  Bad values here can give you a different error.  These configuration files also tell it things like memory limit, how to direct certain traffic and a whole lot more. Bad values here can create an error because the server doesn’t know what to do with them and it can’t keep working.
  • Coding Errors, such as
    • Plugin Functions – Typos, bad commands and bad values can wreak havor on your WordPress site, causing a 500 internal server error.  PHP and your server work really hard to figure out a way around the errors but sometimes it can’t.  When that happens, you’ll get the 500 Internal Server Error on WordPress and you need to fix the issue before continuing.
    • Theme Functions

How to Fix 500 Internal Server Error in WordPress

Unfortunately, there are a number of things that can cause a 500 Internal Server Error that stops your WordPress site from working.  Some things are very easy to fix. Others, not as much.  Thankfully, if you, or someone else, aren’t doing

When you want to fix a 500 Internal Server Error in WordPress, it can be a real hassle.  Your site is completely down and there isn’t a clear fix.  We are going to go over some of the common causes and how to fix them.  We will also show you some ways to diagnose the issue.  Unfortunately, some of these get pretty technical.  You may need to access your site using FTP, or File Transfer Protocol.  This will give you direct access to the files, even if your site isn’t working.

RELATED:   Where WordPress Pages Are Stored

Backup Your Site

This doesn’t really do anything to fix your site, but some of our suggestions are pretty invasive.  Before you do anything, back up your site.  Some hosts, like Siteground and A2 Hosting have an easy way to do this.  Otherwise, we always recommend Updraft Plus.  It’s a simple plugin and has a lot of functionality to backup and restore your site in the free version. 

Try Reloading The Page

Before you do anything, try reloading the page.  Sometimes, it’s a momentary issue and you just need to reload things.  If it happens again (or keeps happening occasionally) then you should check out the other solutions.

Clear Your Browser Cache

To make your browsing experience faster, your browser saves (or caches) a bunch of things like formatting files (CSS files), images and a lot more.  This is usually a great thing but sometimes it can be a real pain.  In that case, we recommend that you start by clearing the browser cache. 

An important thing to know is that this will usually sign you out of any sites you’re logged into so make sure you have those passwords handy.  This is a great way to start in fixing any website problem.

Here are instructions for clearing the cache in common browsers:

Chrome: https://support.google.com/accounts/answer/32050?hl=en&co=GENIE.Platform%3DDesktop

Safari: https://support.apple.com/guide/safari/clear-your-browsing-history-sfri47acf5d6/mac

Firefox: https://support.mozilla.org/en-US/kb/how-clear-firefox-cache

If the easy solutions don’t work, we will have to try a few other things to troubleshoot the issue.

Increasing PHP Memory Limit in WordPress

Increase From Cpanel

Sometimes, your site can’t get enough memory to do what you’re trying to do.  This is more common when trying to use something complex like a builder (e.g. Elementor or Beaver Builder) or a complicated theme (e.g. Divi).  Sometimes this is a server limitation and you’ll need different hosting but before you try that, let’s see if you can just increase the amount of memory that your server is giving to your site.

Before you try these instructions, you might try just asking support to help you out.  They may be willing to do this for you (which is a lot easier and less likely to break something.)

If you are using Cpanel on your hosting, you can easily increase the PHP memory limit.

  • First, open Cpanel from your hosting account.
  • Under software, click on MultiPHP INI Editor link.
  • Under configure PHP INI basic settings, select your website.
  • Now, you can see the memory_limit option.
  • Then, change the value like 128M or 256M based on your server RAM.
  • Now, click on the apply button.
  • After that reboot your server.
  • Finally, memory limit successfully increased.
C-Panel Resource Usage
  • Now, click on the apply button.
  • You may need to reboot the server.  This varies from host to host on how to do it. Sometimes, there is a “Restart Services” button.  Other times, you need to log into a terminal (a command line interface) and type “ssh reboot” or “reboot”.  If you don’t have experience with this, it may be best to ask the support team at your host.
RELATED:   How to Install WordPress in C-Panel - Step by Step Guide

Let’s see if that helps.

Check for Problems in Your .htaccess File

The .htaccess file controls a lot of things about how your server works.  It controls using permalinks in WordPress, caching, access to directories, and a lot more.  There are a lot of plugins and processes that change the .htaccess file.  It’s an important file and typos or problems can break WordPress.

To test this, we’re going to slim down the .htaccess file to a bare minimum and see if your site works. Then you can work on getting it fixed or have a developer fix it for you.

You can do all of this using FTP, but here we’re going to walk through how to do it using the File Manager in C-Panel. Siteground has a similar function that looks almost the same.

  • Log into your C-Panel.
  • Locate the File Manager.  Click on that. – https://wpearnonline.com/wp-content/uploads/2021/04/File-Manager-C-Panel.png
  • .On the left, you will see a list of all the directories.  You need to find the directory that has your website files in it.  It usually is something like public_html.  Open that.  Once you’re in there, you should see a bunch of files and some directories. If you’re in the WordPress directory, you should see the directories wp-admin, wp-content and wp-includes.  If so, then you should be in the right place (it might be a bit different if you have multiple websites on the same server.)
File Manager public_html Directory Structure

One of the files should be .htaccess (with the period in front.)  If you don’t see it, go to the upper right and find the Settings button. Click that.

File Manager Search Bar
  • That will open a popup window.  Make sure that “Show Hidden Files” is selected.  This should show the file.
File Manager Preferences

Now find the .htaccess file.

File Manager - htaccess File
  • Let’s start by making a copy of it so that we can restore it.  Right click on the file and select copy.
File Manager - Copy File
  • A new popup window will open.  It should start in the current directory.  Add a filename like “htaccess.bak”.  This should copy the file.
File Manager - Copy Popup
  • You should see your new file in the list of files.  You may need to click the Reload button at the top.
File Manager - htaccess Backup File
  • Go back to your .htaccess file. Right click on the file and select Edit.  This will open the file in a new window.
File Manager - htaccess Backup File
  • Select all the contents in the file and delete them.  (Don’t worry, we made that backup.)
  • Paste this into the file:
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f\
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
  • Save the file.
  • Try to reload your website and see if anything has changed.  If it has, then there was a problem in your .htaccess file.  If everything is functioning normally, you may not have to do anything more but if things like caching don’t work or you get SEO warnings then you may want to talk to a developer for more help.  We’ve given you some help on that below.
RELATED:   Creating a Child Theme in WordPress

Turn off All Plugins and Themes

One of the first things to try when you have weird things going on in your site is to turn off the plugins and the theme.  Unfortunately, if you can’t access the site itself, this isn’t all that easy.  If you can log into the admin section of your site then you can turn off all the plugins and see if that works.  Then, you can turn them back on one at a time until you find the one that is working again.

If you can’t log in to your admin section of the site, then you’ll need to access your files via FTP.  Go to the wp-content directory. In there, you will see several directories. 

  • First, change the name of the plugins directory to “off-plugins”
  • Then, go into the themes directory.  You will need a default theme for this to work (like “Twentytwenty” or “Twentytwentyone”.  Otherwise, you’ll have manually install one.  Change the name of the directory of your theme (which should match the name of the theme) and add “off-” to the name of the directory. This will turn off your theme. WordPress will then look for a default theme.

If your site loads now (it will probably be ugly, but that’s okay) then you know it’s a theme or plugin problem.  Go back and change the directory of your theme back to the correct name (remove “off-“).  This will turn the theme back on. If the site loads, then it’s a plugin problem.  If not, then turn your theme back off and go on to the next step.

Change the name of your plugins directory back to “plugins”.  Then, go into the plugins directory and add “off-” to the beginning of each plugin. Make sure the site still loads.  Change each plugin back to its original, one at a time, until the site doesn’t load anymore.  Your problem is most likely the last plugin you changed.  Now you at least know the culprit.

You may need to remove that plugin or reach out to the developer and have them help you with the problem. Sometimes, a plugin will work fine by itself but not with certain other plugins.  In this case, you may need to find an alternative or one of them to the plugin or the theme. This will require a little bit of experimentation by trying different plugins and themes (or a different approach completely.)

Fixing the 500 Error in WordPress

If none of these work, you may need to hire a developer to help you out. Before you do that, you can ask for support from your host.  If it’s a true server issue, they will likely help you but, if not, there’s a good chance that they will not help because the problem is with your site or configuration.

Leave a Comment

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

Share via
Copy link
Powered by Social Snap