How to Quickly Fix 500 Internal Server Error in WordPress
Are you getting 500 Internal Server Error in WordPress? Don’t panic! It is one of the most common WordPress errors that many of the webmasters face often.
It’s technically a server-side error when the server can’t communicate with your website and as a result, the server shows internal server error.
Unlike any other WordPress errors, this error doesn’t tell what the exact problem is.
Since the problem is not created by users and the error doesn’t give any information, it could be quite frustrating to users. But this problem can be fixed once we know what is the cause.
In this article, we will show you how to fix 500 internal server error in WordPress.
What Causes 500 Internal Server Error?
The internal server error in WordPress can be occurred by a number of reasons, such as:
- corrupted .htaccess file
- reaching PHP memory limit
- problematic plugin(s)
- corrupted WordPress core files
These are the common causes that create internal server error in WordPress site. Because the error is from the server side, it can appear anytime on your site and the site will be inaccessible.
In case you are getting 500 internal server error on your WordPress site, you can easily fix it with the help of following solutions.
Let’s fix internal server error in WordPress.
Note: Before you start, I highly recommend you to take a full backup of your WordPress files and database. If something goes wrong, you can easily restore your site.
How to Fix 500 Internal Server Error in WordPress
Here are the most common solutions for fixing internal server error in WordPress.
1. Fixing Corrupted .htaccess file
The .htaccess file is a configuration file that is used by Apache-based web servers. The file is located in the root directory of a WordPress site.
The .htaccess file can be used for URL shortening, setting permalinks, website optimization, site redirection etc. As it controls the configuration of a web server, even a small mistake can create a problem like – internal server error in WordPress.
Fortunately, the issue can be fixed by creating a new .htaccess file. I will show you how to do it.
Step 1, Rename the .htaccess File
The first thing you need to rename the .htaccess file using your hosting cPanel or FTP client, but the method is the same for both.
The cPanel process is very short and easy, so I will show you using cPanel.
- First login to your hosting cPanel account and go to the root directory (File Manager> public_html) of your WordPress site
- From there find the .htaccess file and click on rename
- Give it a name to something like .htaccess_old
- Save the file
Now refresh your website and some other pages to see if the solution fix the internal server error problem. If the internal server error no longer appears, then move to the next step which is recreating a new .htaccess file.
Step 2, Recreating new .htacess File
Next, login to your WordPress dashboard and navigate to Settings> Permalinks and click on the Save Changes button at the bottom.
By saving the permalinks will automatically create a new .htaccess file.
If this solution doesn’t fix 500 internal server error in WordPress, then check the following method.
2. Fix Internal Server Error by increasing WordPress PHP Memory Limit
The internal server error can also appear if your WordPress site hits the PHP memory limit.
By default, WordPress automatically tries to increase PHP memory limit to 40MB which is not enough sometimes especially if you are running a heavy site or a bunch of poorly coded plugins. This can create extra stress on your server and as a result, you can see internal server error.
To increase PHP memory limit in WordPress,
- Login to your hosting cPanel and navigate to File Manager
- Open the public_html folder and go to the wp-admin folder
- Now create a new file php.ini inside the wp-admin folder
- And lastly, add a small piece of code in that file
Once you are done, don’t forget to save the file.
Increasing PHP memory limit might fix 500 internal server error in WordPress but this is just a temporary solution. Because you still need to find the plugin that is eating up your server resources.
If that was causing the problem, you wouldn’t see it from now. Now refresh your webpage a few times and see if it is gone.
If you still see the internal server error, then most probably the error is appearing because of a problematic plugin.
3. Delete the Problematic Plugin(s)
Most of the time the internal server error in WordPress occurs due to a broken plugin or plugin collisions.
In case the internal server error appears, you wouldn’t able to access your WordPress admin dashboard. So, you need to deactivate your WordPress plugins manually using cPanel or FTP client.
- First, log in to your hosting cPanal and go to the root directory of your WordPress site
- Go to wp-content> plugins folder
- Rename the plugins folder to something like plugins_old
Once you renamed the plugin folder, all the plugins will be deactivated. Don’t panic. You wouldn’t lose any of your plugins.
Now refresh your website in incognito mode and hopefully, you can access your website.
If you go to the plugins section, a message will appear like “…plugin has been deactivated due to an error: Plugin file doesn’t exist“.
Now we know that the cause of internal server error is a plugin, it’s time to find and eliminate the problematic plugin.
- Rename the plugins_old folder back to plugins and login to your WordPress dashboard
- Activate your plugin one by one and keep refreshing your website each time until the error appears
- If you re-activate a plugin and the internal server error appears, then you have found the plugin that caused the issue
- Now simply delete the plugin via cPanel or FTP and report the issue to the plugin developer
4. Upload Fresh WordPress Core Files
If all the previous solutions fail, then most probably the 500 internal server error in WordPress is caused by corrupted WordPress core files.
However, this case is rare but you know anything can break anytime.
To repair your WordPress core files, you need to re-upload wp-admin and wp-includes folders to the root directory. But don’t worry, this wouldn’t remove any information.
- First, go to the WordPress.org website and download a fresh version of WordPress
- Extract the zip file on your computer
- After extracting it, inside the WordPress folder locate the wp-admin and wp-includes folders. We just need these two folders
- However, the cPanel method is easier but in this case, I recommend you to upload these two folders using an FTP client
- Login to your WordPress directory using FTP client
- From the left side, select the wp-admin and wp-includes folders on your computer, right click on it and click upload
This will start uploading the two folders.
It will ask you if you want to overwrite these files. First, click on always use this action and then ok.
Now, wait for the upload complete and you are done.
Refresh your website a couple of times to see if this fixed the error.
Note: If none of the above solutions fix 500 internal server error in WordPress, you must need to reach out to your web hosting support. Ask them to troubleshoot the issue and hopefully, they will fix it from their end.
Internal server error is a common WordPress error. It can occur due to several reasons, for example, corrupted .htaccess file, hitting PHP memory limit, problematic plugin etc.
However, the internal server error doesn’t state a particular cause of the issue, it became a headache to many WordPress users.
In this article, we have discussed 4 different solutions that can fix 500 internal server error issue in WordPress.
Did you ever face the 500 internal server error issue? If yes, which solution worked for you? Do let us know in the comment section. 🙂
If you find this tutorial helped you to fix 500 internal server error in WordPress, do share it with your friends.
More WordPress Resources,
- How to Totally Block Spam Comments and Registration Bots in WordPress
- How to Automatically Log Out Idle Users in WordPress
- How to Share an Unpublished Draft in WordPress Before It’s Published