When compared to other HTTP error codes and status codes, the internal server error (http error 500) is the most annoying problem for any WordPress website. Even if your hosting server is operating normally, you won’t have any clear information regarding the issue.
In this article, we’ve made an effort to discuss every facet of the 500 internal server error. You will be competent to resolve this problem on your own in the future once you have finished reading this article.
What is the 500 Internal Server Error?
If you Google the 500 internal server error, you may find various explanations, but they are still unclear. After all, the error notification does not offer any real clues to what went wrong and caused the problem.
Even though the 500 error is due to some issue on the server itself, our experience speaks that these errors generally occur from one of two reasons:
- error in the website coding(client-side issue)
- server malfunction
No matter what caused the internal server error, remember, it usually has something to do with the website itself. If you have a WordPress website, the error may have occurred if the script of your theme or plugin was somehow flawed or has a bug. That may have been the reason to make the server crash.
Now that you know what the 500 internal server error is, it is time to fix it.
How to Fix/Troubleshoot 500 Internal Server Error?
he problem with the 500 internal server error is that there isn’t a clear way of knowing its cause. At times, it is possible that all of it is a minor glitch in the system. It can go away once you refresh the website and reload the page after waiting for a couple of minutes. Sometimes, clearing the browser history will do the trick so try doing that before exploring further troubleshooting options.
If these don’t work, we have other ways to crack this problem.
1. Try Enabling Error Logs
You have to enable the debugging feature for WordPress by editing the wp-config.php file of your website. All you have to do is add a line to the code: define( “WP_DEBUG”, true );
1 | define( “WP_DEBUG”, true ); |
Click the Save button and try reloading your site. There is a chance that the server error will be gone and, a different error that can tell you where the issue is will take its place.
Now, you can take a look at the location of the issue. If it is within a plugin folder, you can disable that plugin and, the error will be no more.
It is advisable to leave the debugging turned on until you resolve the error, even if it seems unnecessary. After all, turning on debugging may not fix the problem, but it may provide you additional details to help you better understand the issue. It will offer more insight to you and the developers into the root cause of the error.
Also, once you have resolved done with the maintenance, do not forget to turn the debugging off.
2. Deactivate Plugins and Change the WordPress Theme
Log in to your WordPress dashboard via the admin account and deactivate/disable all plugins. Check if the error still persists by reloading the website.
If everything goes back to normal and your website loads without the server error, you can assume that the issue was with one of the plugins. To figure out which one, you will have to activate and deactivate each plugin until you come across the one that causes the error.
If it is not your plugins, it is probably your website’s theme. Try to switch your WordPress theme to the default and consistent themes like Twenty Fifteen or Twenty Sixteen. Reload the site again once you have changed the theme to see if the error is still there.
In most cases, the cause of the error is usually some plugin with a bug or improper compatibility.
3. Reassess the .htaccess File
If your WordPress website has a .htaccess file, it will have a set of rules that tells the server what actions to take in certain circumstances. You can use the file to rewrite URLs or block access to your site to suspicious visitors.
You will have to edit the .htaccess file to see if one of the rules is the cause of the error. Create a backup of the file and remove all of its content. You may end up deleting some of the crucial rules. Still, it is the only way to know if the internal server error has occurred because of the .htaccess file. If it resolves the error, it will confirm that the issue lies within the .htaccess file.
Now to the grinding!
Restore the complete file from the backup after deleting and restoring each of the blocks one at a time. Do not forget to keep reloading the website each time. This way, you can then remove that line and with it the 500 internal server error. If you are not confident with this method, ask your developer or call support for further assistance.
4. Increase the Memory Limit
It is rare, but there are times when your WordPress website passes the memory limit you assigned to it. It may cause the 500 internal server error and, to resolve it, you have to increase the memory limit for WordPress via the control panel. This issue is more common in shared environments.
If that resolves the error, you will have dealt with it only temporarily. There is a strong possibility of a malfunctioning code(probably a third-party plugin) that constantly requires a lot of memory. You will have to monitor your resource usage by activating/deactivating the plugins to determine which one is eating away at the allocated memory of your website.
If that resolves the error, you will have dealt with it only temporarily. There is a strong possibility of a malfunctioning code(probably a third-party plugin) that constantly requires a lot of memory. You will have to monitor your resource usage by activating/deactivating the plugins to determine which one is eating away at the allocated memory of your website.
5. Reinstall WordPress
You can try to go old school and resolve the issue in the simplest way by reinstalling the WordPress application. It is not a guaranteed solution to fix the error but, there is a chance it will fix file permission problems.
To do this, you will have to remove and install the WordPress application. I recommend you contact the support before proceeding with it.
6. Contact the Service Provider
As a user, there is a limit to diagnose and deal with the 500 internal server error. It is not uncommon that some issues leading to internal server errors in WordPress are actually related to the server-end. It means you will have to involve the hosting provider and discuss the problem with them.
Your provider can at least confirm if it is a genuine server issue or not. They can also investigate the probable sources causing the error, like file permissions to sort it.
7. Change/Upgrade the Hosting Service
If your site faces the 500 internal server error more often, you should consider switching to better service plans. Upgrading the service plans may cost a bit higher, but it saves you a great deal of trouble as it provides better server resources.