A 500 internal server error in WordPress can catch you unawares and unprepared. It can also cause unplanned downtime for your service resulting in frenzied search for answers.
Before we dive into the possible solutions to the internal server error, you should know that most of the time, such errors have nothing to do with your server and are actually the result of some malfunction in your WordPress website.
You might see a message on screen similar to the one below.
Your site is inaccessible and you cannot login to your WordPress dashboard. All hope lost?
How to Troubleshoot the Internal Server Error
The good news is that there are multiple solutions to the 500 server error, just like the other common WordPress errors, which we will go through one by one.
Check the Plugins and Themes
The internal server error could’ve been caused by a malfunctioning plugin or theme that you installed or updated recently. Did you install a new plugin or theme or updated any that resulted in the 500 error?
Since you will not be able to login to your website, you can access the plugin and theme folder using FTP or your host’s control panel if your web host provides a dedicated file manager.
Quality web hosts like Dreamhost provide one-click access to the File Manager so you don’t need to use an FTP program like Filezilla to access your WordPress files.
Once you have accessed your website files, go to the wp-content folder. Within this, you will find the plugins folder. Rename this folder to some other name like ‘plugins-old’.
Now, all the plugins will get deactivated. Try accessing your site. If your site is working, it means that one of the plugins caused the 500 internal server error. So, you should login to your WordPress admin area and head straight to the plugins panel.
You will not see any plugins since you have renamed the folder. But don’t worry since all your plugins are safe and sound.
Just use your FTP program or File Manager and restore the plugins folder to its original name i.e. plugins.
Now head back to your plugins directory in the WordPress admin panel and you will be again able to see all your installed plugins. But the plugins will be deactivated, which is what we want in order to catch the rogue plugin that resulted in the 500 internal server error.
You should activate each plugin one by one to recreate the 500 server error. If one of the plugins triggers the error again means you have identified the rogue plugin.
Then you can head back to the plugins folder in your WordPress installation using FTP or File Manager and delete the conflicting plugin from within the parent plugins folder.
This will remove the 500 internal server error from your WordPress website for good.
You can try out this method for your WordPress themes as well. To do so, first, rename the themes folder to some other name like themes-new. Now if you try accessing your site, it will either show a message that the themes directory does not exist or continue to show the 500 HTTP error.
All you have to do is restore the folder name to themes in your WordPress installation.
This will switch the theme to the default WordPress theme. Check your website now. If it is working, means that your theme was causing the server error.
Install the Health Check and Troubleshooting Plugin
The Health Check and Troubleshooting plugin is very useful for detecting errors and plugin conflicts in your WordPress website. Using the above method, you will need to first rename the plugins folder in order to deactivate all the plugins.
Now, download the Health Check plugin from its homepage and extract the zipped file on your computer. After this, upload the plugin files to your WordPress installation’s plugins folder using FTP or File Manager.
Next, restore the plugins folder name to plugins and head back to your WordPress dashboard. Activate the Health Check plugin only. Let all the other plugins remain deactivated.
In the WordPress dashboard visit Tools>Site Health>Troubleshooting.
Click the ‘Enable Troubleshooting Mode‘ button. All the plugins will get deactivated and the theme will reset to the default theme.
Don’t worry, all your site settings are safe. You can now activate all plugins and themes one by one. If the 500 server error is reproduced, you would have identified the malfunctioning plugin or theme.
Once you have safely deleted that plugin or theme, you can come out of troubleshooting mode and your website will be restored to its original state before the error occurred.
Clear the .htaccess File
Sometimes, your plugins or themes might not cause the 500 server error. In this scenario, your .htaccess file settings might be causing the error.
The .htaccess file is located in the root WordPress installation directory. Locate the file and rename it to any name like .htaccess_new and save it.
Check your website. Did the internal server error disappear? If yes, the .htaccess file settings were the problem.
You should then delete the entire contents of the .htaccess file and restore its file name. Now, go to your WordPress dashboard and navigate to the Permalinks settings. Without changing anything, click save to save your permalinks structure.
The .htaccess file will be automatically repopulated with the permalinks snippet to avoid any 404 page not found error.
Turn on Debugging
You can also turn on debugging mode in WordPress to check the error messages on screen. For this, open the wp-config.php file in your parent WordPress installation directory.
Insert this snippet in the file:
Save the file.
This command tells WordPress to turn on debugging which is set to false by default. Now go back to your website and check out the error messages on the screen.
If you feel you can resolve the error on your own, well and good. If you cannot, then replace the above snippet with this:
This will create a debug.log file in the wp-content folder of your WordPress directory. You can share this debug log with your hosting support or developer for troubleshooting the internal server error.
Increase PHP Memory
The internal server error could also occur if the PHP memory is exhausted. This is more likely on shared hosting servers.
To increase the memory limit, open the wp-config.php file in your root WordPress directory using your FTP program or File Manager and insert the following snippet:
This will attempt to increase the PHP memory limit on your server to 256 MB. Three things can happen here.
The memory limit is increased and the error goes away. This means that some plugin is using loads of resources that needs further investigation.
It could also happen that the memory limit is increased, however, the 500 server error remains. In this scenario, it is not a memory issue.
There is also a possibility that the memory size cannot be increased since your hosting provider has disallowed memory increase by WordPress. Which means that you will need to contact your hosting support to increase the memory limit, at least, temporarily.
Seek Professional Support
If none of the solutions work for you, you should seek professional support from your hosting provider. Managed WordPress hosting providers like Cloudways will not turn down your support request, however, nothing can be said for sure about shared hosting providers.
Shared hosting companies usually do no provide in-depth WordPress technical support. If your hosting provider is unable to help you, you should seek third-party help from a reliable WordPress expert.
You can also let us fix the 500 server error for you. Know about our WordPress troubleshooting services.
A 500 internal server error can be really frustrating since you cannot login to your WordPress dashboard to troubleshoot the problem. However, as discussed on this page, there are multiple solutions possible to fix this nagging but manageable WordPress error.
Which solution worked for you or did you find some other solution? Please share your experience in the comments below.