How to Fix the 500 Internal Server Error in WordPress

How to fix the 500 Internal Server Error in WordPress

Table of Contents

One of the most confusing WordPress error that a beginner can come across is the “Internal Server Error”, or sometimes the “500 Internal Server Error”.

This error usually appears when something goes wrong, but the server is unable to identify where the problem lies. Since the error message doesn’t indicate where to look for the error, it’s up to you to find it.

We have share and create a list of solutions that you can try and one of them will help you solve it.

So, Let’s explore how to fix the 500 Internal Server Error in WordPress.

What is The 500 Internal Server Error?

What is the 500 Internal Server Error in WordPress
What is the 500 Internal Server Error in WordPress

500 internal server error or internal server error in WordPress is a most common web server error. This is not specific to WordPress websites and can happen to any website.

The 500 internal server error code in WordPress is technically an HTTP error code. Searching for this HTTP error code will only show its standard description.

“The 500 internal server error message indicates that the web server facing an unexpected condition that prevent it from fulfilling the HTTP request.”

This is a simple catch-all error message that means the server was unable to assign more helpful error messages when it encountered the problem.

The error page looks different depending on which web server (LiteSpeed, Nginx or Apache) your website is using and which browser you are using.

Here’s what the Apache error page might look like. It may look different if you use Nginx and Google Chrome.

If Google Chrome can’t find an error page to display, it will look different:

For beginners, this can be incredibly frustrating. There are no clues that would point them in the right direction to fix them quickly.

Asking how to fix an internal server error is like asking your physician how to fix the pain you’re experiencing without telling him where the pain is.

However, if we know the common reasons that trigger this error, we can try to fix it one by one to resolve the error without breaking anything.

What Causes The Internal Server Error in WordPress?

WordPress internal server errors are often caused by a corrupt .htaccess file, poorly coded plugins or themes.

Other possible causes of WordPress internal server error that we know of are PHP memory limit or corrupted WordPress core files.

In some conditions, internal server errors may only appear when you are trying to access the WordPress admin area while the rest of the website is working fine.

Now let’s take a look at how to fix the 500 Internal Server Error in WordPress.

How to fix the 500 Internal Server Error in WordPress

Before you start to fixing it, make sure you have a full backup of your WordPress  website.

If you have access to the WordPress admin area, you can use a WordPress backup plugin to create a full backup of your website.

How to fix the 500 Internal Server Error in WordPress
How to fix the 500 Internal Server Error in WordPress

On the other hand, if you don’t have access to the WordPress admin area, you can create a WordPress backup manually by using phpMyAdmin and an FTP client.

After that, you can follow the below steps to troubleshoot and fix 500 internal server errors on your website.

#Clear WordPress and Browser Cache

Sometimes Web browsers and your installed caching plugins can mistakenly store a cached copy of an error page.

The easiest way to fix this is to clear your browser cache first.

Next, if you have access to the WordPress admin area of ​​your website, you can empty the WordPress cache through your caching plugin.

Here’s How to clear WordPress cache.

#Checking for Corrupt .htaccess File

The .htaccess file is a basic web server configuration file that is also used by WordPress to set up redirects.

One of the most common causes of internal server errors is a corrupted .htaccess file.

The easiest way to fix this is to simply go to the Settings » Permalinks page in the WordPress admin area and then click the ‘Save Changes‘ button without making any changes.

WordPress will now try to update your .htaccess file or create a new one for you. You can now view your website to see if this has resolved or not.

If you still see the error, you need to make sure that WordPress is able to create or write to the .htaccess file.

Sometimes, due to files  permissions, WordPress may not be able to generate or write to your .htaccess file.

You can now try replacing the .htaccess file manually. First, you need to access your website files using the FTP or File Manager app located under your hosting control panel. In our case it’s HostPanel.

After that, you need to rename your already exist .htaccess file to something like .htaccess_out. This allows you to keep the file as a backup, but WordPress will not recognize it.

After establishing a connection with the site files. You’ll find the .htaccess file in the same directory, where you’ll find folders like wp-content, wp-admin and wp-includes.

Simply, right-click the .htaccess file and rename it to .htaccess_out.

Next steps, you need to create a new .htaccess file on your site’s root directory.

Inside your site’s root folder, click on the ‘Create New File‘ option in your FTP client or file manager app.

Name this new file .htaccess and save it.

Now, this newly created .htaccess file is empty and you need to add WordPress default rewrite rules to it.

First select the file and then click Edit button in your FTP client or file manager app. The newly created .htaccess file will open in a simple text editor. Now, you need to copy and paste the below code inside it.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

This code is the default rewrite rule set used by WordPress. Don’t forget to save your changes and re-upload the file to the server.

You can now visit your website to check if this has resolved the internal server error or not.

If it does, pat yourself on the back because you’ve fixed the 500 Internal Server Error.

Important:  Before you proceed with other things, make sure you go to the Settings » Permalinks page in the WordPress admin area and click the Save button without making any changes. This will re-create the .htaccess file for you with the correct rewrite rules to ensure that your WordPress pages don’t return 404 errors.

If the corrupt .htaccess file solution doesn’t work for you, then you should continue reading this article.

#Increasing the PHP Memory Limit

Sometimes an internal server error can occur if a script consumes all PHP memory limits. The easiest way to increase the PHP memory limit in your WordPress is to edit the wp-config.php file.

If you are a beginner, be careful when you do this. You want to follow these instructions carefully because even the smallest mistake in WordPress core files can break your website.

To get started, connect to your WordPress files using an FTP client or file manager app under your hosting account control panel.

You will find the wp-config. php file inside the root folder of your website. Right-click on it and select ‘Download‘. This steps will ensure that you have a backup of the wp-config file in case something goes wrong.

After you save it, you can right-click on it and select ‘View/Edit‘.

Inside the wp-config. php file, you need to add the below code just above the line that says ‘That’s all, stop editing! Happy publishing’.

define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

Here’s: How to increase PHP memory limit in WordPress.

If you only see internal server errors when you try to log in to your WordPress admin or upload an image to your wp-admin, then you need to increase the memory limit by following these steps:

  1. Create a blank text file on your computer & name it php.ini.
  2. Paste this code in there: memory=256MB
  3. Save the file
  4. Upload it into your /wp-admin/ folder using FTP client.

If increasing the memory limit solves the problem for you, then you have only solved the problem temporarily. You still need to find the reason that is exhausting your memory limit.

It could be a poorly coded themes or even a plugin. We strongly recommend that you ask your hosting provider to view the server logs to find the correct diagnostics.

If increasing the PHP memory limit doesn’t solve the problem for you, you may need to do some more troubleshooting.

#Deactivate All WordPress Plugins

If none of the above solutions work for you, then this error is most likely caused by a specific plugin installed on your website.

It’s also possible that it’s a combination of plugins that don’t play well with each other.

If you can access the WordPress admin area of ​​your website, you can simply go to the plugins page and disable all WordPress plugins.

However, if you cannot access the WordPress admin area, you can disable all WordPress plugins using FTP.

Simply connect to your WordPress files using an FTP client or file manager app under your hosting control panel.

Once your FTP client connected to your site, navigate to the /wp-content/ folder and rename the existing plugins folder to plugins.disable.

WordPress looks for plugins in the plugins folder. If the plugins folder is not found, it will automatically disable all plugins.

You can now try visiting your website to see if this has resolved the internal server error on your website.

To restore all your plugins, you can simply rename the plugins.disable folder back to plugins.

Your plugins will now be restored but they will still be disabled.

You can now activate the plugins one by one and inspect your website to determine which plugin is causing the internal server error.

Here’s: How to deactivate all WordPress plugins without WP-admin.

If disabling all plugins does not fix internal server errors on your website, continue reading.

#Switch to a Default WordPress Theme

A possible cause of an internal server error could be some code in your WordPress theme.

To find out if this is the case, you need to switch back your currently used theme to a default WordPress theme.

If you have access to the WordPress admin area, simply go to the Appearance » Themes page. If you already have a default theme installed, you can click the Activate button to change the theme.

If you don’t have a default theme installed, you can click the Add New button at the top and install a default theme (Twenty Twenty-Three, Twenty Twenty-Two, etc).

Now if you don’t have access to the WordPress admin area, you can still switch to a default theme.

Just, connect to your WordPress website using an FTP and navigate to the /wp-content/ folder.

Right-click to select the theme folder and download it to your computer as a backup.

After that, you need to delete the theme folder from your website. Once it’s deleted, go ahead and create a new theme folder.

Your new WP themes folder will be empty which means you don’t have any WP themes installed right now.

Next, you need to go to the WordPress theme directory and download a default WordPress theme as a zip file to your computer.

After that you need to unzip the WordPress theme file on your computer.

You will now see a folder containing your WordPress theme.

Go back to your FTP client or file manager and upload this folder to the empty theme folder on your site.

Once uploaded, WordPress will start using the default theme.

You can now check your website to see if this has resolved the internal server error or not.

If that doesn’t work, you can re-upload your WordPress themes from backup or go back to the theme you’re using.

Don’t worry there are other things you can do to fix the error.

#Re-uploading Core Files

If plugin and theme options don’t fix the internal server error, it’s worth re-uploading the /wp-admin/ and /wp-includes/ folders from a fresh WordPress install.

It won’t delete any of your data, but it might fix the problem if a file is corrupted.

First you need to go to the WordPress.org website and click on the download button.

This will download the WordPress as a zip file to your local machine.

Go ahead and extract the zip file. Inside it, You will find a folder called WordPress.

Next you need to connect to your WordPress files using an FTP client.

Once you connected to your website files open the root folder of your website. This is the folder that contains the wp-admin, wp-includes, wp-content folders.

  • Open the WordPress folder on your computer in the left column.
  • Now you need to select all the files inside the WordPress folder and upload them to your website.
  • Your FTP client will now transfer those folders from your computer to your server.
  • After uploading the files, It will ask you, Whether you want to overwrite the files. Select ‘Overwrite‘ and then select ‘Always use this action‘.
  • Your FTP client will now replace your old WordPress files with new, fresh copies.

If your WordPress files are corrupted, this step will fix the internal server error for you.

#Enable Debug Logs in WordPress

WordPress comes with a built-in system to keep logs for debugging.

You can turn it on using the WP Debugging plugin. Here: How to install a WordPress plugin.

Once activated, the plugin will launch a debugging log on your WordPress website.

If you don’t have access to the admin area of ​​your WordPress website, you can turn on debugging by adding the following code to your wp-config. php file.

define( ‘WP_DEBUG’, true);
define( ‘WP_DEBUG_LOG’, true);

Once you turn on debug logs, you can view these logs using an FTP client and navigating to the /wp-content/ folder.

Now you need to open the debug log file in a text editor and it will show you a list of errors and warnings that occur on your website

Some of these errors and warnings can be harmless and not need any fixing.  However, if you see an internal server error on your website, this can point you in the right direction.

#Ask your Hosting Provider

If all methods fail to fix internal server errors on your website, it’s time to get some more help. Contact your hosting provider and they will be able to check the server logs and identify the main cause of the error.

In our case you can always contact our Softxaa tech support team. Our expert team will gladly assist you.

Conclusion:

If you want to continue troubleshooting on your own, check out our All in one WordPress troubleshooting guide for beginners.

We hope this article helped you fix the 500 internal server error in WordPress.

If you’re looking for safest cloud hosting with high priority support. Checkout our hosting plans.

Picture of softxaa

softxaa

Share Us With Your Friends

Get Lifetime Free Domain Now!

Unlock a Lifetime of Value: Get a Free Domain with Any 1-Year Cloud Hosting Plan!

error: Content is protected !!