This Internal Server Error is one the common errors that occur on WordPress that can put you into a state of panic. As panic won’t solve the issue, it is important that you troubleshoot and fix 500 internal server error in WordPress. Today, I will show you how to fix 500 Internal Server error in WordPress by putting together a list of all the possible solutions. As there are many different scenarios that cause this specific error, we will guide you through the problem-solving process with the aim of having all the bases covered so that you can find the right solution.
Note: before doing anything make sure that you have a good backup of your WordPress site (both files and database). This helps you revert back if anything happens.
Why Do You Get the 500 Internal Server Error in WordPress?
At the start, I must mention that the 500 internal server error is not specific to WordPress itself. It can happen with anything else running on your server as well. There may be several reasons why you are seeing the internal server error. Having said that, the plugin or theme functions are often seen as the root cause for this error. Other possible causes include a corrupted .htaccess file and issues associated with the PHP memory limit.
So, no matter what the reason is, let us dive into the troubleshooting process and fix 500 internal server error in WordPress. Follow each method and see what fixes the error for you.
1. Check for Corrupted .htaccess File
The first step in the troubleshooting process is to check for a corrupted .htaccess file.
First, log into your website using any of your favorite FTP clients. Once you are in, proceed to locate the .htaccess file. Generally, it is located in the root folder, i.e. in the same folder as wp-content, wp-admin, and wp-included folders. Sometimes, the file may be hidden, unhide .htaccess file to see it.
After you have located the .htaccess file, proceed to rename it. You can rename it as “.htaccess_old” or something similar.
After you have renamed the file, try loading your website again. If it works normally without a glitch, then you have successfully fixed the internal server error.
However, before you proceed to do anything else, go to Settings > Permalinks on your WordPress dashboard and click on the “Save Changes” button. Yes, don’t change any options, just click on the button.
This will create a new .htaccess file with the proper rewrite rules that will ensure your post and pages don’t return a 404 error. If you are interested, here are some of the best .htaccess rules that every WordPress user should know.
If this solution didn’t work for you as expected, then follow on.
2. Increasing the PHP Memory Limit
Sometimes the 500 internal server error can happen if you are exhausting your PHP memory limit. In that case, you would need to increase it in WordPress.
Log in to your WordPress via FTP like before, and locate the wp-config.php file in the root directory. Open it up, and add the following line at the bottom of the file.
Here we have increased the PHP memory limit up to 64 Megabytes. If you still keep running into the error, or you think that you may need to increase the limit, change the value as needed.
Remember, the hosting provider may limit the memory for your account. In those cases, you have to contact your hosting provider to increase the PHP memory limit.
However, if you keep seeing the internal server error only when you try to login to your WordPress admin area, or when uploading an image, then you should increase the memory limit by following the steps given below.
- Create a blank text file and rename it to “php.ini.”
- Open it and paste the following line in the file
memory_limit = 64M.
- Save the file.
- Upload it to the “wp-admin” directory via FTP
This should fix the 500 internal server error. If not, read on.
3. Deactivate All Plugins
If none of the given solutions worked out for you, then the culprit that is most likely responsible for the problem is the plugins. It can be one specific plugin or a combination of plugins that are clashing with each other. Much to our dismay, there’s no easy way to pinpoint the exact plugin that is causing the issue. The only way is to deactivate all the WordPress plugins at once and re-activate them one by one until you find the culprit.
If you have access to your dashboard, then select the all the plugins and deactivate them using the deactivate option.
If you don’t have access to the dashboard then there are two methods to deactivate the plugins
3.1. Deactivate Plugins Using FTP
Navigate to the wp-content folder in your WordPress site using any of your favorite FTP client or your hosting provider’s file manager.
Locate the folder called plugins. Rename it to anything of your choice. (ex: plugins.inactive)
The plugins on your WordPress website have now been deactivated.
Most of the time when you rename the “plugins” folder, you might be locked out of your WordPress admin panel. However, if the issue was with your plugins, you should be able to login to your admin area.
Once inside, go back to the wp-content folder and change the name of the previously renamed plugins folder back to its original name. (ex:- change the name from “plugins.inactive” back to “plugins”)
Now activate the plugins one by one in the WordPress dashboard till the site breaks down again. At this point, you will know which plugin has been causing that issue.
3.2. Deactivate Plugins Using phpMyAdmin
Note: backup WordPress database before you do anything.
Apart from the fairly easy FTP method, there’s also a second option which is to use phpMyAdmin. We recommend that you use the FTP method if you are not familiar with getting into phpMyAdmin. To start off, log into you cPanel and open phpMyAdmin application.
Now, go into your WordPress database. In the “wp_options” table, locate the option name “active_plugins”.
Edit the value of that option to the following
As soon as you enter the above code snippet, you will receive a message something like “1 row has been affected.” With this, all your plugins will be deactivated.
Again, login to your site and reactivate all the plugins one by one till you find the abusing plugin. When all the plugins have been deactivated and reactivated, be sure to remove the faulty plugin from your site.
4. Re-upload the Core Files
If troubleshooting your plugins and all the other methods didn’t solve 500 internal server error in WordPress, then it is better to re-upload the “wp-admin” and the “wp-includes” folders.
Just download the latest version from the official site and upload both the above folders to your site using FTP.
This process will not remove your information from the site, but it can solve the problem if there is any corruption in the core files.
5. Contact your Hosting Provider
If none of the above solutions fixed 500 internal server error then you will need to get in touch with your hosting provider. They can take a look at the server logs help you to come to a solution based on what actually is happening in the background.
That’s all for now, feel free to leave any thoughts, comments and feedback in the comments section below on how to fix 500 internal server error in WordPress.