How to Fix Internal Server Error in WordPress
The 500 internal server error runs on every page of your site when there’s a problem with the server or file system powering your site. The cause most likely happens in the root directory, where your WordPress files are, but it can also be caused by a problem on your host’s server.
This is one of the most frustrating errors that can happen in WordPress. It never has a straightforward solution, demanding a lot of troubleshooting that can eat up your time and patience. But we’re going to try to help alleviate some of that stress by recommending several solutions to this problem and walking you through each.
What is the 500 Internal Server Error?
The web definitions of the 500 internal server errors are somewhat unclear. There’s no real indication as to what went wrong and caused the error.
The only sure thing is that the error is caused by some operation that went wrong on the website’s end. Particularly in WordPress’s case, this can mean that a script that’s part of a theme or a plugin did something it shouldn’t have done, and now your server has crashed.
How to Fix WordPress 500 Internal Server Error
We recommend you perform these steps in order. That is, start at Step #1 and work your way through the list. In a few situations, we’ll tell you to skip ahead based on one of the steps’ results. But in general, top to bottom!
Beyond that, just a reminder that we always recommend backing up your site before making any changes in this list. If you can’t reach your WordPress dashboard to use a backup plugin, you should still be able to create a backup through your hosting dashboard — ask your host’s support for help if you’re not sure how.
Fix 1: Create a Backup
First, you need to create a backup of your site to make changes to its root directory. If your web hosting server offers website backup, use it. But, it is better to create a backup of your own.
You can utilize a WordPress backup plugin such as BackUpWordPress, VaultPress, and BackupBuddy. If you don’t have it already, it’s time to get one.
Fix 2: Know How to Use an FTP Client
You will also need to know how to use an FTP Client. You can also use a File Manager. However, an FTP client is faster, customizable, robust, and more accessible to use. An FTP client is a tool that allows you to access and edit your website’s server files.
FileZilla is the most popular FTP Client. It is open-source software. However, you can use an FTP client of your choice.
Fix 3: Troubleshooting Options
Now, let’s look at a few general troubleshooting options to remove the WordPress internal server error.
- Create a New ‘.HTACCESS FILE’
- Using the FTP client, open your website’s root directory named public_html.
- You should be ready to see files named wp-admin and wp-content.
- If not, press on the Server tab, and select Force Show Hidden Files option to view the hidden files.
- Find your .htaccess file, and right-button click to rename the file as .htaccess.bak. It will delete the old file.
- Now you need to create a new file.
- Go to Settings → Permalinks.
- Scroll down and click the Save Changes button. Don’t make any changes.
The .htaccess file handles the contour of your web server. If the 500 internal server error was due to this configuration matter, creating a new .htaccess file will resolve it.
Expand your PHP Memory Limit
If this doesn’t solve your WordPress HTTP error, you can try increasing your PHP memory limit. Usually, your host will set the boundary for PHP memory. It is often low for a shared hosting plan. (Maybe it’s time to get an entire hosting plan.)
WordPress will try to extend this limit by itself. However, it can’t pass the limit set by your host. So, you’ll need to do it manually.
- Open your root directory.
- Locate the wp-config.php file and download it by right-clicking.
- Add the following code under the opening PHP tag using a text editor of your preference.
- define(‘WP_MEMORY_LIMIT’, ‘250M’);
- Now, save and re-upload the data to your root directory.
Let it replace the original file. Refresh your FTP client and your site to see if the answer code 500 continues to show. If it does, the PHP memory limit is not the cause. So, you should eliminate the above code from the wp-config.php file, save it, and re-upload it to your root directory.
Sometimes, however, you may require to increase the memory limit to more than 250MB. So, this will be a trial and error method depending on your website’s required memory limit.
Identify and Replace Faulty Plugins
Next, you can try identifying and replacing faulty plugins to resolve the issue.
- Go to the WordPress admin section, and start deactivating your plugins one by one.
- After each deactivation, refresh your website to verify if the error code 500 disappears.
- You can also utilize the FTP client to identify a faulty plugin.
- Enter the root directory and open the wp-content folder.
- Now add each plugin one by one to the empty directory, and refresh your site each time to see if the error is fixed.
If it does, remove the plugin in question. If the plugin is essential for your website, find an alternative that works. If you can’t get a replacement, contact the website developer.
Debug Your Site
You can use WordPress’ built-in debugging feature if you find it difficult to determine the cause of error code 500. However, only an experienced WordPress developer should do this. You will require to add a small code in your wp-config.php file.
Check File Permissions
While you are at it, you should also check file permissions. It’s worth a try. Usually, it would be best to set the permissions to 755 or 644 for the folders and files in your WordPress directory.
Using the FTP client, open your root directory. Most FTP clients have a Permissions tab that you can use to check each file and folder’s permissions. Make sure everyone is set to either 755 or 644.