How to Fix the 500 Internal Server Error in WordPress

How to fix 500 server error

What is meant by 500 Internal Server Error?

An often seen web server issue is the 500 internal server error. This is a problem that may affect any website, not just WordPress.

In technical terms, the error code 500 in the message is an HTTP error code. You will only see the usual explanation of this code when you look it up:

The server was unable to complete the request due to an unforeseen circumstance, as indicated by the 500 Internal Server Error response code.

Since the server was unable to determine a more appropriate and useful error message upon encountering the problem, it has assigned this generic catch-all error message.

Your website’s web server software (Apache or Nginx) and browser will determine the appearance of the error page. 

An example of an Apache error page may look like this:

It may look different if you are using Nginx and Google Chrome.

It will also look different if Google Chrome is unable to find an error page to display: 

Why Does WordPress Present the "Internal Server Error"?

A broken.htaccess file, plugins with bad code, or your current WordPress theme are common culprits behind the internal server issue in WordPress.

Other probable reasons of the internal server problem in WordPress include the PHP memory limit or faulty core WordPress files.

Sometimes, even if the rest of your site is functioning well, you may only get the internal server error while attempting to enter the WordPress admin area.

Usually, the error is triggered before WordPress can load and the server cannot gather enough information about what stopped it.

Read our article on the inner workings of WordPress if you want to know more.

Now that we’ve covered everything, let’s get into the process of fixing the WordPress internal server problem.

Resolving WordPress 500 Internal Server Error

Make sure you have a full backup of your WordPress site available before you start debugging.

To make a full copy of your WordPress site, all you need is access to the WordPress administration area and a WordPress backup plugin.

Duplicator is the way to go for this. With its aid, you can easily create backups of your website, save them to the cloud, and—most importantly—restore them whenever necessary.

If you are unable to enter the WordPress administration area, you may manually build a backup of WordPress by using phpMyAdmin and an FTP client.

Then, to resolve the website’s internal server problem, you may proceed by following these instructions.

Load the Cache from Your Browser and WordPress

On rare occasions, both your browser and WordPress caching plugins may inadvertently save a cached version of an error page.

Clearing your browser’s cache is the first and simplest step to remedy this. 

After that, go to the settings page of your caching plugin, which should be accessible from inside the WordPress admin section of your website. From there, you may clear the WordPress cache.

To learn more, check out our guide on clearing WordPress cache.

Verifying whether the.htaccess File Is Corrupt

WordPress uses the.htaccess file, which is part of the server setup, to establish redirects. The corrupt.htaccess file is a typical source of internal server errors. To remedy this, go to the WordPress admin area, go to Settings » Permalinks, and click the “Save Changes” button without making any changes.

At this point, WordPress will make an effort to either update or create a new.htaccess file. Now you may check whether the internal server problem has been fixed by visiting your website. Verify that WordPress successfully created or updated the.htaccess file if the issue persists.

In some cases, WordPress may not be able to read or modify your.htaccess file because of restrictions on certain files and directories. Now you have the option to manually change the.htaccess file. Start by going to your hosting account’s control panel and logging in using your FTP or File Manager credentials. From there, you may access your website.

After that, change the extension of your primary.htaccess file to a more descriptive one, such as.htaccess_old. You may save the file for future reference in this way, but WordPress will not be able to open it. Renaming the.htaccess file requires accessing your site through File Transfer Protocol (FTP) or the File Manager app within the cPanel dashboard of your hosting account.

Following successful connection, you will be able to find the.htaccess file in the same directory as other WordPress files and directories, such as wp-content, wp-admin, and wp-includes.

Renaming the.htaccess file to.htaccess_old is as easy as right-clicking on it.  

The next step is to create a fresh.htaccess file.

Press and hold the “Create new file” option in your File Manager or FTP client when you’re at the root folder of your site. 

Give the new file the extension.htaccess and hit the “OK” button to save it. Currently, this.htaccess file is blank and needs to have the default rewrite rules for WordPress added to it.

Choose “View/Edit” from the context menu of your FTP client or File Manager program after right-clicking the file.  Notepad or TextEdit, or any plain text editor, will open the blank file.

The next step is to insert the following code:

# 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

As a default, WordPress uses this code set for its rules. Before you return the file to the server, be sure to save your modifications. Now you may check whether the internal server problem has been fixed by visiting your website.

If so, you should be proud of yourself for resolving the internal server problem. Prior to proceeding, ensure that you visit the WordPress admin area’s Settings » Permalinks page and click the Save button without making any changes. To avoid the 404 problem when accessing your post pages, this will automatically rebuild the.htaccess file with the correct rewrite rules.

Leave a Reply

Your email address will not be published. Required fields are marked *