In this article, I will explain 500 internal server errors in WordPress.Since the error does not give any other information, many beginners find it quite frustrating. So in this article, I will explain the troubleshooting steps of 500 internal server errors in WordPress.
Internal server error in WordPress is mostly caused by plugins or themes installed. Other causes of internal server error in WordPress that we know of are: corrupted .htaccess file and exhausted PHP memory limit.
We shall now head to troubleshooting the internal server error in WordPress.
1: Checking for Corrupt .htaccess File
It should be the very first thing you should do while troubleshooting the internal server error in WordPress is check for the corrupted .htaccess file.
You can rename your main .htaccess file to .htaccess_old. To rename the .htaccess file, you would need to login to your site using FTP or File Manager app in your hosting account’s cPanel or via ssh to the server
Once you are logged in, the .htaccess file will be located in the same directory where you will see folders like wp-content, wp-admin, and wp-includes.
Once you have renamed the .htaccess file, try visiting your site to see if this solved the problem.
Also, make sure that you go to the Settings » Permalinks page in the WordPress admin area and click the save button without making any changes. This will generate a new .htaccess file for you with proper rewrite rules else pages can return a 404 error.
If still not fixed go to step 2
2:Increase the PHP Memory Limit
if the error logs the state of reaching the memory limit while during the operations in the WP website, then you should increase the memory limit by following these steps:
1. locate the php.ini
2. Increase the memory limit, upload max_file size or post max size according to the log
3. Save the file
4.Upload it into your /wp-admin/ folder using FTP
In most the cases doing the above should fix the admin side problem
If this fixed the problem for you, then you have only fixed the problem temporarily and need to find the cause that is exhausting your memory limit.
The are chances that a poorly coded plugin or even a theme function could throw the error
If increasing the PHP memory limit did not fix the issue for you, then you are in for some more troubleshooting.
3: Deactivate all Plugins
If none of the above solutions worked then this error is would be caused by a specific plugin. It is also possible that could be due to plugin compatibility
Sadly, there is no easy way to find this out. You have to deactivate all WordPress plugins at once by renaming it to a random one.
f disabling all plugins fixed the error, absolutely then it is one of the plugins that is causing the error.
To find it out we need to reactivate one plugin at a time until you find the one that caused the trouble. Deactivate that plugin, and report the error to the plugin author.
4:Re-uploading Core Files
If the plugin option didn’t fix the internal server error, then it is worth re-uploading the wp-admin and wp-includes folder from a fresh WordPress install. This can be used if the wp core files are corrupted
Download the wp from the official website matching the version as present in wp-includes/version.php to your local machine
Extract the zip file and you will find a WordPress folder.
Now you need to connect to your Word-press website using an FTP client. Once connected navigate to the root folder of your website. This folder houses wp-admin, wp-includes, wp-content folders inside it.
In the left open the WordPress folder on your local machine. Now you have to select wp-includes and wp-admin folders and then right-click and select ‘Upload’.
Please refer to the below images.
Your FTP client will now replace your older WP files with newer fresh copies. If your WP files were corrupted, then this step will fix the internal server error for you.