How to Fix the 500 Internal Server Error in WordPress

How to Fix the 500 Internal Server Error in WordPress

Is your WordPress displaying 500 internal server errors?  The internal server error is amongst the commonest WordPress errors. Many users find it difficult to get it as it doesn’t display any other detail. We will explain how to fix the 500 internal server errors in WordPress easily.

What Causes Internal Server Error in WordPress?

The internal server error is not confined to WordPress only. It may happen with any website running on a web server. 

The error does not provide any information to the developer because of its non-specific nature.

In WordPress, these internal server errors may be caused by Theme or plugin functions. The other causes for internal server error in WordPress that we are aware of, are: PHP memory limit and corrupted .htaccess file.

In addition, there are cases when an internal server error only appears when you try to log in to the admin area while the rest of the site works well.

Now, moving on to fix the internal server error in WordPress.

Increasing the PHP Memory Limit

The internal server error may occur when you have reached your PHP memory limit. You can see our article on how to increase the PHP memory limit in WordPress.

If you notice the internal server error only when you log in to your WordPress admin or you upload an image in your wp-admin, then you can increase the memory limit by the following steps:

  1. Make a blank text file named php.ini
  2. Copy and paste this code there: memory=64MB
  3. Then Save the file

 If the Error disappears after increasing the memory limit, then the error is only fixed temporarily. You still have to find the source that is using up your memory limit.

This may be the poorly coded plugin or a theme function. We suggest that you ask your WordPress hosting company to check the server logs and help you to find the exact reason.

If the error is not fixed by increasing the PHP memory, then the reason is something else, and you must try the next method to fix the issue.

Checking for Corrupt .htaccess File

While fixing the internal server error in WordPress, the next thing you should try is to look for the corrupted .htaccess file.

For that, rename your main .htaccess file to anything like .htaccess_old. You can rename the .htaccess file by login into your site using the FTP client or File Manager app in your cPanel dashboard.

After that, locate the .htaccess file in the same directory where you will find the folders like wp-content, wp-admin, and wp-includes.

After renaming the .htaccess file, try to visit your site to check if this resolved the issue. If it did, then you have successfully fixed the internal server error.

Then, visit the Settings » Permalinks page in the WordPress admin area and click on the save tab without making any changes. 

This will now generate a new .htaccess file for you with proper rewrite rules to confirm that your pages and posts do not return a 404 error.

If the solution doesn’t work for you, you can try resolving this with the next method.

Deactivate all Plugins

When both the solutions don’t work for you, the error is probably caused by a specific plugin. In addition, it may be due to the combination of plugins that aren’t compatible with each other.

Sadly, you can’t easily find out the faulty plugins. Therefore, you need to deactivate all WordPress plugins.

You can follow the instructions in our tutorial on how to deactivate all WordPress plugins without WP-Admin.

If disabling all plugins fixed the internal server error, then there is a plugin that is causing the error.

Now you have to reactivate the plugin one by one to detect the faulty one.

So, visit your WordPress admin area and click on the ‘Plugins’ to find the one that created the issue. 

Remove that plugin, and report the error to the plugin developer.

Re-uploading Core Files

If the plugin solution also fails to fix the internal server error, then we suggest re-uploading the wp-admin plus wp-includes folders from a fresh WordPress installation.

This will not remove or erase any of your details and documentation, but it may resolve the error in case there is any corrupted file.

For that, visit the WordPress.org website and click on the Download tab.

Now, it will install a WordPress zip file to your computer. You have to extract the zip file, and you will find a WordPress folder inside it.

Then, you have to connect to your WordPress website using an FTP. After that, go to the root folder of your website, which contains wp-admin, wp-includes, wp-content folders inside it.

In the left menu, open the WordPress folder on your computer. Then, select wp-includes and wp-admin folders and right-click on them, and select the ‘Upload’ tab.

Now, Your FTP client will transfer those folders to your server. Then, you have to select an action whether you like to overwrite the files. Select the ‘Overwrite’ option and then select ‘Always use this action.’

Now, the FTP client will replace your older WordPress files with fresh new copies. 

If any of your WordPress files were corrupted, this step would fix it, and the internal server will disappear.

Ask your Hosting Provider

If all the methods fail to resolve your website’s internal server error, you have to get some more help. 

To do that, contact your web hosting support team, and they will be able to help you. They will check the server logs and find out the root cause of the internal server error.

To conclude- If you see the 500 internal server errors in your WordPress, you can try using our solutions to fix the issue.

We hope this helped you fix the 500 internal server error in WordPress. If you are experiencing any other error on your site, you can fix it by following the steps told in our other article on what to do when you are logged out of the WordPress admin area.

Leave a Comment