A Complete Guide to Fix the 500 Internal Server Error in WordPress
The most common type of error any WordPress user might face is ‘500 Internal Server Error’. This error doesn’t provide much of any detailed information and thus, making it frustrating for many beginners to resolve it.
If you too are looking for a solution for the same error, then keep reading because we have covered how to fix the 500 Internal Server Error in WordPress.
Causes of Internal Server Error in WordPress
500 internal server error occurs not only in the WordPress platform but also on any website developed in any other platform. It does not tell the developer any details because of the generic nature of this error.
The common reason that causes internal server error in WordPress is due to plugin or theme functionalities. Another possible element for this error might be corrupted .htaccess file and PHP memory limit.
We have also come across instances where you get the error while accessing the admin area and at the same time, the rest of the website works fine.
Now that you know all the possible areas where the error can take place, let’s see how to troubleshoot these issues one by one.
Checking for Corrupt .htaccess File
This is the very first step while troubleshooting the internal server error in WordPress. You initially need to check for any corruption in the .htaccess file.
This can be done by renaming the existing .htaccess file to .htaccess_old or something like that. If you need help in renaming the .htaccess file, we will help you do so.
- Using FTP, sign in to your website directory or you can even sign in using the file manager app from your cPanel dashboard provided by your hosting provider.
- In the root itself, where you see other folders like wp-admin, wp-content and wp-includes, you will find .htaccess file. You just need to rename it.
- Now, visit your website again and see if the problem is resolved.
- If not resolved yet, you need to go to your WordPress admin area and under ‘Settings’ go to ‘Permalinks’ page and click ‘Save’ without doing any modifications. This step will automatically create a new .htaccess file with desired rewrite rules to make sure that your pages do not return a 404 error.
If this solution did not work for you, then read further troubleshooting steps to resolve your issue.
Increasing the PHP Memory Limit
If you have overspent your PHP memory limit, there are chances that you might get an internal server error.
Here’s how to fix it:
- Edit the wp-config.php file in your WordPress directory. This file can be found in your root folder itself.
- In the file, locate this line “That’s all, stop editing! Happy blogging.”
- Add the below code just above that line
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
By adding this code, it will tell WordPress to raise the PHP memory limit to 256MB. - Now, you need to save the file and upload this file back to your server.
Sometimes, the internal server error occurs only when trying to login to the admin panel of WordPress dashboard or while uploading an image in wp-admin. In such cases, you can increase the memory limit with these steps:
- Create a blank text file and name it as php.ini
- Paste this code in there: memory=64MB.
- Save php.ini file.
- Using FTP, upload this file in your /wp-admin/ folder.
For most of the users, the problem got fixed. And if your problem got resolved too, with the above steps then you have fixed the problem only temporarily. The main cause of the issue for exhausting your memory limit still needs to be found.
To find the exact diagnostics you can consult your WordPress hosting provider to check the server for the problem.
If both the above things did not solve your error, then you are in for some more troubleshooting.
Deactivate all Plugins
If you are still facing the same error, then probably one of your plugins is causing the error. There is also a possibility that the combination of your plugins does not gel well with each other.
Unfortunately, there is no specific way to identify such a plugin. You will have to make all your plugins inactive at once.
If deactivating the plugins solved your error, then it’s clear that one of your plugins was the reason for the error.
Go to ‘Plugins’ in your WordPress admin area and reactivate your plugins one by one. In this way, you can identify which plugin caused the issue and later report the error to the plugin developer.
Re-uploading Core Files
Freshly installing some WordPress files might help in case the plugin option did not fix your issue.
Don’t you worry, this will not remove any of your information, but it can help you get rid of the error in case any file was corrupted? To do this:
- Visit www.WordPress.org and click on the ‘Get WordPress’ button.
- This will download the WordPress zip file on your PC which needs to be extracted into a folder.
- The next step is to connect your FTP client to your WordPress website. Later go to the root folder of your website. You will see wp-content, wp-admin, wp-includes folders inside it.
- In your FTP, open the folder where you extracted the downloaded WordPress folder. Select wp-includes and wp-admin folder and click ‘Upload’ by right-clicking on it.
- You will be asked if you want to overwrite those files. Select ‘Overwrite’ and then your FTP client will transfer those folders to the server.
Those old files are now replaced with the fresh ones. So, in case your WordPress files were corrupted, doing this will fix the internal server error for you.
Consult your Hosting Provider
If you tried all the above ways and still can’t put an end to the internal server error, then it’s time to get some further help. Get in touch with your web hosting provider support team and ask them for server logs to identify the root cause of the error.
Final Thoughts
The 500 internal server issue is really annoying as it doesn’t have a clear cause or a defined solution. It takes a lot of troubleshooting steps, as you have seen above, but we hope this article has helped you at least to make the task a little less irritating or resolve the issue.
At the last, ensure that you take backup of your website regularly and update your themes, plugins and core WordPress files.
To prevent the occurrence of this issue, ask your theme’s developer if their theme is compatible with all the plugins that you have installed. as this may result in corrupting your .htaccess file.
In the end, ensure that you upgrade your web hosting package if necessary. This is because this error can arise if you have a small-budget hosting plan, and your website is exceeding that limit.
So, it’s crucial that you upgrade your plan or choose another web hosting provider that is capable of handling your growing business website.