How to Fix a 500 Error on Your WordPress Site

A website can suddenly stop working for a variety of reasons. Successful requests for a website usually give a status code of 200. One of the first things that we can do when a website isn’t working is to find out the status code returned by the server. This might not always lead you directly to the root cause of the problem, but it can sometimes help in determining the next series of steps that you can take to get the website up and running again quickly.

In this post, you will learn how to fix a 500 error on your WordPress website.

What Is a 500 Error and What Causes It?

A 500 error basically means that the server has come across an unexpected situation that it didn’t know how to handle. As a result, it serves users with either a 500 error page or a completely white screen.

The explanation doesn’t help us much, but there are some common things that can cause this error. Here are some examples:

  1. a corrupt .htaccess file
  2. faulty or incompatible plugins
  3. limited PHP memory
  4. corrupted WordPress core files

Fixing a 500 Error on a WordPress Website

Now, we will briefly go over the steps that you can take to resolve any errors caused by the issues mentioned above. Let’s get started.

A Corrupt .htaccess File

Any misconfiguration of the .htaccess file can potentially cause a 500 error. You should consider reading this getting started guide on .htaccess to learn more about this file if you aren’t already familiar with it.

The easiest way to fix it is to take a backup of the current .htaccess file and then delete it from your server. You can usually find it in the root directory of your WordPress hosting account.

Download and Delete .htaccess FileDownload and Delete .htaccess FileDownload and Delete .htaccess File

Make sure you download the file first before deleting it. This will allow you to upload it again if you find that the .htaccess file wasn’t causing the error.

Try visiting your website after deleting the .htaccess file. If deleting the file resolves your 500 error, you can generate a fresh .htaccess file by visiting Settings > Permalinks and then clicking on Save Changes. Otherwise, simply upload the old .htaccess file back to your server.

Generating an .htaccess FileGenerating an .htaccess FileGenerating an .htaccess File

Faulty or Incompatible Plugins

Sometimes the plugins or themes that you have installed can result in a 500 error due to some incompatibility or other faulty code. The best way to resolve any errors caused due to this incompatibility is to simply deactivate all the plugins and then see if you are still getting the 500 error.

If deactivating all the plugins solved the problem for you, then this means that one of the plugins is causing the 500 error. Now, you can start activating each of them one by one to see which of them is at fault. Keep checking the website for a 500 error after activating each plugin.

Deactivated WordPress PluginsDeactivated WordPress PluginsDeactivated WordPress Plugins

If activating a plugin shows you a 500 error, you can contact the plugin developers to let them know about this issue so that they can fix it in the next update or suggest a quick fix.

Limited PHP Memory

Although rare, it is possible that you are getting a 500 error because something inside a theme or plugin is exhausting all your allocated memory. One quick fix for this is to simply increase the memory limit.

Open the .htaccess file that you learned about in the first section and place the following lines inside it.

It would be better to place them just before # END WordPress in order to avoid any unexpected surprises. This should increase the allocated memory. You can check the new values by going to Tools > Site Health > Info > Server inside the WordPress admin dashboard.

WordPress Site Health InformationWordPress Site Health InformationWordPress Site Health Information

Remember that this is just a temporary quick fix. The ideal solution would be to find out what exactly is causing this spike in memory use and then fix that function inside the plugin or theme. Otherwise, you will run out of memory again sooner or later.

Corrupted WordPress Core Files

It is highly unlikely that corrupted WordPress core files could be causing a 500 error on your website. However, this fix is worth a try if none of the above resolved the error for you.

What we are trying to do here is replace the core WordPress files for two directories called wp-admin and wp-includes. You shouldn’t be making any changes to the contents of files located inside these directories as they are used to keep WordPress functional. Changing anything there either intentionally or unintentionally can result in a 500 error.

The first step is to visit the WordPress download page and get the latest version. After that, you can extract the contents of the downloaded file and replace the files inside the wp-admin and wp-includes directories in your WordPress installation with these fresh, unaltered copies using your FTP client.

Final Thoughts

In this post, I mentioned four different reasons that might cause a 500 error on your WordPress website and briefly explained how you can fix each of them. Hopefully, one of these will resolve the 500 error. Consider contacting your web host to get some additional help if none of the steps mentioned here worked for you.

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

How to Fix a 500 Error on Your WordPress Site

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.