Have you ever randomly visited your WordPress site and been greeted with an internal server error? This may be happening to you right now:
This is a scary error because just like an error establishing a database connection, your site completely disappears. But you don’t have to worry too much about it. This error is fixable and chances are that your WordPress site’s data is safe.
Read More: How to fix “Error Establishing A Database Connection” in WordPress?
What does Internal Server Error mean?
Internal Server Error, which is what your server gives you when there is a problem. It tells you that something went wrong, but it doesn’t tell you what exactly went wrong.
This is not a satisfying explanation, but then again, it is not a specific error either.
What is the cause of “Internal Server Error”?
Because this error is so broad, there is no single cause for it. The most common causes with WordPress are:
- .htaccess getting corrupted.
- Issue with some plugins.
- PHP memory limit reached.
- WordPress corrupt core files
So let me tell you the solutions to deal with all these problems. But if you want to quickly find out what exactly is going wrong, your server’s error logs can quickly tell you what is the cause of the problem.
If your host uses cPanel, you can view this by going to your cPanel dashboard and then clicking on the Error log.
Unfortunately, as you can see from the image below, these error logs are not always user-friendly to read.
If you don’t see anything specific from the error log, you can:
- So you can contact the support of your host so that they can tell you what exactly the problem is.
- Simply solve some common issues, which I am telling you about below.
The following hosts offer confirmed cPanel:
- Bluehost
- HostGator
- SiteGround
- Inmotion Hosting
How to fix “Internal Server Error” in WordPress?
Below are some of the most common ways to fix this error in WordPress. I recommend you start from the top and work your way down.
Potential Fix 1: Generate a new .htaccess file
The .htaccess file is a file for the configuration of your web server. WordPress uses it to set the structure of your permalinks.
Because it controls the configuration of your web server, even a small mistake in this file can result in an internal server error.
But thankfully, this problem is very easy to solve. All you have to do is force WordPress to generate a new .htaccess file for you.
Step 1: Rename your existing .htaccess file
To begin, you need to rename your existing .htaccess file. You can do this in two ways:
- Connect your site via FTP. You can use Filezilla to do this.
- You can also use cPanel’s built-in file manager tool.
I am going to show you the process using the file manager because it is simpler for most users. But the core principles will remain the same, no matter which method you are using.
You can access Final Manager from the cPanel dashboard:
Once you open the File Manager, go to your root directory and locate the .htaccess file.
Right-click and choose Rename.
Rename it to anything like, “.htaccess_old”.
Now you will have to generate a new .htaccess file to replace it.
Step 2: Generating a new .htaccess file
To force your WordPress to generate a new .htaccess file, go to your WordPress dashboard.
Then go to Settings → Permalinks.
You do not need to change any settings.
Just click on the save changes button and WordPress will automatically generate a new file for you.
And hopefully, your site will start working again.
Potential Fix 2: Deactivate your plugins and locate the faulty plugin.
If the .htaccess file wasn’t your problem, the next thing you can try is deactivating plugins. Usually, plugin issues and conflicts can cause internal server errors. This often happens when you install a new plugin and immediately get an error.
By deactivating plugins, you can find and delete the problem-causing plugin.
If you can still access your WordPress dashboard, then here’s how to deactivate your plugins:
If you can still access your dashboard, go to your plugin management area, then use the checkbox to deactivate all plugins.
Now reactivate the plugins one by one so that you can find the plugin that is creating the problem.
If you can’t access your dashboard, here’s how to deactivate plugins:
When an internal server error occurs, there are high chance that you will not be able to access the dashboard. In such a case, you will have to take a slightly different approach to deactivate the plugins.
- In such a situation, you will have to resort to a file manager or FTP. You can also use Filezilla.
- Go to /wp-content/ folder.
- Rename the plugins folder like plugins_old.
This will deactivate all plugins.
Now try to access your WordPress dashboard, if you can access it, then you will be confirmed that the issue is with a plugin.
If you go to the plugins section of your dashboard, it will give you the error: “The plugin has been deactivated due to an error; plugin file does not exist.”
Don’t worry, we have found that the problem is with a single plugin.
To reactivate plugins one by one:
Rename the plugin folder from plugins_old to plugins again.
Now reactivate the plugins one by one from the WordPress dashboard.
After activating each plugin, browse 3-4 pages of your blog. Keep doing this until the internal server error appears again. You will find the faulty plugin.
In most cases, this will be the solution to your problem.
Potential Fix 3: Increase the PHP memory limit of your web hosting
If this still doesn’t resolve your issue, there are still a few things you can do:
As you know WordPress is a memory-hobbing CMS, so when you install more plugins or WordPress needs more memory for some other thing, you need to increase the PHP memory limit, otherwise, an error will occur.
To do this, you need to edit the wp-config.php file. You can also access this via FTP or file manager.
/* That’s all, stop editing! Happy blogging. */ You have to add this code before the message:
define( ‘WP_MEMORY_LIMIT’, ’64M’ );
This will only work if your host has not set a lower memory limit for you.
For this reason, if you don’t notice any changes after editing this file, you will need to contact your host to increase the limit.
Potential Fix 4: Re-upload WordPress core files.
Finally, if nothing happens, you will have to upload a clean copy of WordPress core files. For this work, I recommend you use the FTP program instead of File Manager.
Note: Make sure that before doing all this, you take a complete backup of your site.
Download the latest version of WordPress from WordPress.org:
Once the download is finished, extract the ZIP file and delete it:
- wp-content folder.
- wp-config-sample.php file.
After this, upload all the remaining files to your WordPress site via FTP. Your FTP program will prompt you for duplicate files. When this happens, do not forget to select the option to Overwrite duplicate files.
Fixing the Internal Server Error Message
At this point, some solution might have worked for you and your internal server error would have been solved. If not, I would recommend you contact your host’s support team. And if they can’t help you, you can hire a WordPress developer to fix things.
You can also comment, maybe we can solve your error together! Let me know if you faced this error and what did you do to solve it. Do share this article on social media so that more and more WordPress users can get help in solving errors.