This error is not specific to WordPress and can happen on any web server. Unfortunately, the error doesn’t specify what the issue could be. In WordPress it is most often caused by plugins or theme functions.
Here are 5 steps to debug this error.
Check the .htacces file
To check to see if the problem is caused by the .htaccess file you need rename it.
The .htaccess file is located in the root directory of your WordPress installation. This is the same directory where the /wp-admin, /wp-includes & /wp-content folders are located.
Connect to your server via FTP or the File Manager link in your hosting account panel.
Next, you want to rename the file to something like .htaccess_backup.
Once you’ve renamed the file, visit your website (or refresh the page) to see if the site is working again.
If it is, great! You’ve fixed the problem. However, you need to do one more thing before you’ve completely solved the issue.
In your Admin Dashboard go to Settings > Permalinks and click the SAVE button without making any changes.
This will re-generate the .htaccess file and ensure your readers don’t encounter 404 pages when visiting your site.
If this doesn’t fix the problem, proceed to the next step.
Increase the PHP memory limit
The error can also be caused by a plugin or theme function exhausting your current PHP memory limit.
If this is the case you can increase the PHP memory limit but you’ll still need to deal with the core problem after you’ve got your site running again.
To increase the PHP memory limit you need to edit the wp-config.php file.
You’ll need to edit the file by connecting to your server via FTP or with the File Manager inside your hosting account panel.
The file is located in the root directory of your WordPress installation.
Add the following code to the bottom of the file.
define( 'WP_MEMORY_LIMIT', '256M' );
This will tell WordPress to increase the PHP memory limit to 256 MB, which should be more than enough.
Then save your changes and check your site.
If this fixes the problem, great! But you still need to find the root cause of the problem that is exhausting your PHP memory.
As I mentioned before it is most likely a poorly coded plugin or theme function.
I recommend you contact your hosting provider and ask them to check the server logs.
If increasing the memory limit didn’t work, proceed to the next step.
Deactivate all plugins
If the previous 2 steps haven’t worked, the issue could most likely be a plugin, as is often the case.
However, there is no way to tell which plugin it is. So you have to deactivate them all, and then re-activate them all one-by-one to identify the problem plugin.
To disable all your plugins, in your Admin Dashboard, go to Plugins > Installed Plugins and click the checkbox to select all plugins.
Then from the Bulk Options drop-down, select Deactivate and click Apply.
Then check your site. If the problem has disappeared then you know one of the plugins is the culprit.
To identify which one it is, you will need to reactivate them one by one until you discover the problematic plugin.
Once you’ve identified the plugin, report the issue to the plugin author (developer).
Re-install core WordPress files
The 500 internal server error could also be caused by corrupted core WordPress files.
In order to fix that you’ll need to re-install the files.
In the latest version of WordPress, they’ve made this quite easy.
In your Admin Dashboard go to Dashboard > Updates and you’ll see the following.
Click on Re-install Now and let the process run. This will re-write all the core WordPress files instantly.
This process will not overwrite any of your theme, plugin or uploaded files, nor will it affect your database.
If this works then you’ve solved the problem. If not, you’ll need to get help from the experts.
Ask your hosting provider
If all the previous steps have failed to solve the 500 internal server error you should contact your hosting provider.
Ask them to check the server logs and located the root cause of the error.
If this tutorial helped you, please comment below and let us know what you think.
Wow, awesome post. Thanks again 🙂
[…] Let’s use the example of an error most WordPress site owners will experience at some point. The 500 Internal server error. […]