How to Fix the 500 Internal Server Error on Your WordPress Website

  Web Hosting

The 500 internal server error runs on every page of your site when there’s a problem with the server or file system that’s powering your site. The cause most likely occurs in the root directory, where your WordPress files are, but it can also be caused by a problem on your host’s server.

Common Solutions for the 500 Internal Server Error

The two most common causes of this error are a corrupted .htaccess file and exceeding your server’s PHP memory limit. The .htaccess file in your WordPress directory can become corrupted after you install a plugin or make another change to your WordPress site. The fix is simple. All you need to do is create a new .htaccess file.

PHP memory limit issues often occur as the result of a poorly-coded plugin running on your site or a site that’s grown considerably over time and is using too many plugins. You’ll begin to exceed the PHP memory limits set by your hosting provider once either of these things happen. The result is a 500 internal server error.

Increasing Your PHP Memory Limit in WordPress

PHP memory limits are set by your host and WordPress. WordPress will attempt to increase your limit if you begin exceeding it, but it can only go as high as the limit your host has placed on your server. This limit is often lower for shared hosting plans. You need to increase your PHP memory limit in WordPress and refresh your site to test whether or not this is causing your 500 internal server error.

Step 1. Open your root directory,File_manager
Step 2. Locate your wp-config.php file
Step 3. Right-click on the file, and click on edit
Step 4. Add this bit of code under the opening PHP tag:

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

Step 5. Save the file, and refresh your site.

If you still see the error, you are not having PHP memory limit issues. Remove the above code from the wp-config.php file and save it again.

Less Common Solutions for the 500 Internal Server Error

Fixing a corrupted .htaccess file and increasing a site’s PHP memory limit are the top two solutions for fixing this error, but there are other solutions if those haven’t helped you.

They are as follows:

  • Deactivating plugins to check for faulty plugins.
  • Checking if your files and folders have the correct file permissions.
  • Uploading fresh wp-content and wp-includes folders to your site.
  • Asking your host if the issue is on the server that powers your site.

If you’re able to access the WordPress admin area, deactivate your plugins one by one. Refresh your site after each deactivation. If the error disappears, it was likely caused by the plugin you deactivated prior to refreshing.

Delete the plugin and find a replacement if its function is important for your site. If you don’t feel you can replace the plugin, contact the developer directly. You can do this within the plugin’s support forum on WordPress.org, but I recommend doing a bit of research to see if the developer offers support elsewhere.

If you cannot access the WordPress admin area, open your FTP client or cPanel File Manager Provided by Host. Open the root directory, and open the wp-content folder. This folder contains your Plugins, Themes and other folders. 

Rename the Plugins folder to anything you wish, such as “plugins.test”. This deactivates all of the plugins on your site. Refresh your site. If the error is gone, it was caused by a faulty plugin. Activate each plugin one by one, refreshing your site after each activation, to find out which plugin is causing the error.

Note: Make sure you rename the folder back to “Plugins” afterward.