Last Updated on10 min read
Are you seeing 500 internal server error in WordPress? Internal server error is one of the most common WordPress errors. Since the error doesn’t give any other information, many beginners find it quite frustrating. In this article, we will show you how to easily fix internal server error in WordPress.
Internal server error is not specific to WordPress. It can happen with any website running on a web server. Due to the generic nature of this error, it does not tell the developer anything.
Asking how to fix an internal server error is like asking your doctor how to fix the pain without telling them where the pain is.
Internal server error in WordPress is often caused by plugin or theme functions. Other possible causes of internal server error in WordPress that we know of are: corrupted .htaccess file and PHP memory limit.
We have also heard internal server error only showing up when you are trying to access the admin area while the rest of the site works fine.
That being said, now let’s take a look at how to go about troubleshooting the internal server error in WordPress.
Tracking down the cause and administering the solution for this issue can be tricky, but you can usually narrow 500 internal server error issues down to a few specific causes. They are:
- Faulty or poorly-coded WordPress plugins
- A problem with your server or hosting environment
- Corrupted .htaccess file on your server
- Issues with your site’s PHP memory limit
- Corrupted core files within your WordPress installation
We’re going to go over how to fix each of these issues, but let’s go over something important first.
Considerations before you begin with troubleshooting
There are a couple things I recommend doing before you try to fix the 500 internal server error on your site. The solutions we’re about to implement include deleting files on your site and replacing them with fresh copies. This is dangerous and can be detrimental if you accidentally delete an essential file. This is why I recommend backing up your site before trying to fix it.
Unfortunately, the 500 internal server error is notorious for blocking access to the backend of WordPress, so I can’t recommend a simple backup plugin for you to use to create a quick copy. Start by consulting your host and asking them if they have an up-to-date copy of your site. Some hosts even allow you to access a log for the backups they’ve created for your site.
Checking for Corrupt .htaccess File
The first thing you should do when troubleshooting the internal server error in WordPress is check for the corrupted “.htaccess” file.
You can do so by renaming your main “.htaccess” file to something like “.htaccess_old”. To rename the .htaccess file, you will need to login to your site using FTP or File Manager app in your hosting account’s cPanel dashboard.
Once you connected, 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. If it did, then give yourself a pat on the back because you fixed the internal server error.
Before you move on with other things, make sure that you go to Settings » Permalinks page in 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 to ensure that your post pages do not return a 404 error.
If checking for the corrupt .htaccess file solution did not work for you, then you need to continue reading this article.
Increasing the PHP Memory Limit
Sometimes internal server error can happen if you are exhausting your PHP memory limit.
If you are seeing the internal server error only when you try to login to your WordPress admin or uploading an image in your wp-admin, then you should increase the memory limit by following these steps:
- Create a blank text file called php.ini
- Paste this code in there: “memory=64MB”
- Save the file
- Upload it into your /wp-admin/ folder using FTP
Several users have said that doing the above fixed the admin side problem for them.
If increasing the memory limit fixed the problem for you, then you have only fixed the problem temporarily. You still need to find the cause that is exhausting your memory limit.
This could be a poorly coded plugin or even a theme function. We strongly recommend that you ask your WordPress web hosting company to look into the server logs to help you find the exact diagnostics.
If increasing the PHP memory limit did not fix the issue for you, then you are in for some more troubleshooting.
Deactivate all Plugins
If you’re able to access the WordPress admin area, deactivate your plugins one by one. Refresh your site after each deactivation. If the error disappears, it was likely caused by the plugin you deactivated prior to refreshing.
Delete the plugin and find a replacement if its function is important for your site. If you don’t feel you can replace the plugin, contact the developer directly. You can do this within the plugin’s support forum on WordPress.org, but I recommend doing a bit of research to see if the developer offers support elsewhere.
If you cannot access the WordPress admin area, open your FTP client. Open the root directory, and open the wp-content folder. This folder contains your Plugins, Themes and other folders.
Rename the Plugins folder to anything you wish, such as “plugins.test”. This deactivates all of the plugins on your site. Refresh your site. If the error is gone, it was caused by a faulty plugin. Activate each plugin one by one, refreshing your site after each activation, to find out which plugin is causing the error.
Make sure you rename the folder back to “Plugins” afterward.
Debugging Your WordPress Website
If you’re having trouble figuring out what’s causing this error to run on your site, you may want to use WordPress’ built-in debugging feature. Pasting a bit of code into your site’s wp-config.php file enables debugging on your site. Any errors found are recorded in a file in your directory.
If you’re a developer, go ahead and start debugging your site. If you’re an average site owner, you may want to sit this one out as you may not know the difference between a minor error that can be safely ignored and a major error that should be taken care of promptly.
Normally, debugging a live site is frowned upon as it may reveal essential code to site visitors, among other things. However, it may be the only thing that explains what might be causing the 500 internal server error to run on your site.
Checking File Permissions
This likely isn’t the issue, but it’s still worth checking. In your WordPress directory, permissions for folders and files should be 755 or 644. Setting permissions to anything else may cause problems, including 500 internal server errors.
Open your root directory in an FTP client. Many clients, including FileZilla, have a Permissions tab you can use to quickly check the permissions for each file and folder in your root directory. Make sure these are not set to anything other than 755 or 644.
Uploading Fresh Versions of wp-admin and wp-includes to Your Site
This step should be a last resort, but if you’ve used the above solutions and still cannot find one that works, it’s worth a try. Backup your site, and download a fresh version of WordPress from the main site.
Extract the files from the ZIP file, and open the extracted folder. Open your site’s root directory in an FTP client, and upload the wp-admin and wp-includes from your fresh version of WordPress to your site’s directory, overwriting the older versions.
Refresh the client, and refresh your site. If the error is gone, it was likely caused by a corrupted core file. If you still see the error, you may have no other option than to contact your host.
Contacting Your Host
If you’ve gone through all of these steps and still cannot find a solution, your host may have it. It is, however, important that you go through these steps to ensure the issue is not occurring in your root directory.
The quality of the support you receive differs between hosts, but many hosts may shrug the issue off and blame your site’s files rather than their servers. This isn’t out of the question as third-party plugins and themes do cause plenty of issues that are out of your host’s hands.
So, it’s important that you go through all of these steps so you can explain to them that you’ve checked every nook and cranny of your file system and can’t find a single issue that would lead to the 500 internal server error that’s running on your site.
Politely ask them to check their server logs to see if the issue is there.
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 will NOT remove any of your information, but it may solve the problem in case any file was corrupted.
First you will need to visit the WordPress.org website and click on the Download button.
This will install WordPress zip file to your computer. You need to extract the zip file and inside it you will find a wordpress folder.
Next you need to connect to your WordPress website using an FTP client. Once connected go to the root folder of your website. It is the folder that has wp-admin, wp-includes, wp-content folders inside it.
In the left column open the WordPress folder on your computer. Now you need to select wp-includes and wp-admin folders and then right-click and select ‘Upload’.
Your FTP client will now transfer those folder to your server. It will ask you whether you would like to overwrite the files. Select ‘Overwrite’ and then select ‘Always use this action’.
Your FTP client will now replace your older WordPress files with newer fresh copies. If your WordPress files were corrupted, then this step will fix the internal server error for you.
he 500 internal server error is a frustrating issue as it doesn’t always have a clear cause or a clear solution. It requires a lot of troubleshooting, as you’ve learned, but I hope these steps have at least made the task a little less irritating.
All in all, make sure you back up your site on a regular basis and update your plugins, themes, and WordPress core files as soon as they’re available. A great way to prevent this issue is to ask your theme’s developer whether or not their theme or an update to their theme is compatible with the plugins you’re running on your site as this may corrupt your .htaccess file.
Lastly, make sure you upgrade your hosting package accordingly. This error is most likely to occur on a small-budget shared hosting server, so it’s important for you to begin researching other options so you can move your site to a server capable of handling your growing site.
Have you ever had this issue? Share your experience in the comments!