How to fix the 500 Internal Server Error in WordPress

Common solutions to this annoying WordPress / server issue

500 Internal Server Error
Image Source: geralt – Pixabay.com / License: CC0 Public Domain

The 500 internal server error is a frustrating issue to have with a website. It can block access to your site for all users, and it can even block your access to the backend of WordPress (wp-admin). What’s even more frustrating is the sheer number of causes that could be producing this error, but what exactly is it? Well, in short, it’s a generic HTTP status code.

HTTP status codes are generated when an issue is occurring on a website, and the exact code your site produces lets you know what error is occurring. The reason I used the adjective “generic” to describe the 500 internal server error status code is because this code simply tells you that there’s an internal issue with the server that must be rectified, but it doesn’t tell you what that issue is or even where it’s occurring on the server. Thus, let the troubleshooting commence!

What causes the 500 Internal Server Error in WordPress?

Questions
Image Source: qimono – Pixabay.com / License: Public Domain CC0

Tracking down the cause and administering the solution for this issue can be tricky, but you can usually narrow 500 internal server error issues down to a few specific causes. They are:

  • Faulty or poorly-coded WordPress plugins
  • A problem with your server or hosting environment
  • Corrupted .htaccess file on your server
  • Issues with your site’s PHP memory limit
  • Corrupted core files within your WordPress installation

We’re going to go over how to fix each of these issues, but let’s go over something important first.

Considerations before you begin with troubleshooting

Caution
Image Source: ferarcosn – Pixabay.com / License: CC0 Public Domain

There are a couple things I recommend doing before you try to fix the 500 internal server error on your site. The solutions we’re about to implement include deleting files on your site and replacing them with fresh copies. This is dangerous and can be detrimental if you accidentally delete an essential file. This is why I recommend backing up your site before trying to fix it.

Unfortunately, the 500 internal server error is notorious for blocking access to the backend of WordPress, so I can’t recommend a simple backup plugin for you to use to create a quick copy. Start by consulting your host and asking them if they have an up-to-date copy of your site. Some hosts even allow you to access a log for the backups they’ve created for your site.

FTP Clients
Image Source: Clker-Free-Vector-Images – Pixabay.com / License: CC0 Public Domain

If your host doesn’t have a backup, use the backups app in cPanel to backup your account. You should also open your site in an FTP client and download a copy of your entire root directory for WordPress, which is typically a folder named public_html or else. You should also backup your database via phpMyAdmin. Better safe than sorry!

Speaking of FTP, the second thing you may need to do is learn how to use an FTP client, such as FileZilla. You may be able to complete these steps using the File Manager in cPanel alone, but definitely learn how to use this tool if you run into trouble. Now that that’s said, let’s get started.

Solution #1: Deactivate all plugins

WordPress Plugins
Image Source: Clker-Free-Vector-Images – Pixabay.com / License: CC0 Public Domain

This is the simplest solution to this common problem in WordPress. At least if the 500 internal server error is being caused by a faulty plugin. Deactivating every plugin on your site at once can help you determine whether a plugin is the cause of the issue.

Access your site’s root directory via FTP or the File Manager app in cPanel. Open the wp-content folder, and rename the plugins folder to anything else, such as pluginsz. Renaming this folder disrupts WordPress’ access to it, which causes every plugin in that folder to become deactivated.

Refresh your site now that all of your plugins are deactivated. If the 500 internal server error disappears, it was being caused by a faulty plugin. Log into the backend of your site, and head to the Plugins page. Activate the first plugin in your list, and re-open your site in a new tab. If you don’t see the error again, activate the next plugin. Do this until you find the plugin that produces the error message. After you’ve found the plugin that is causing the issue, just get rid of it.

Solution #2: Consult your hosting company

Hosting Server
Image Source: ColossusCloud – Pixabay.com / License: CC0 Public Domain

There may be an issue going on with your server only your host can correct. Nothing you do will fix the issue if this is the case. Consult your host, and ask if there are any issues going on with the server that could be producing the 500 internal server error on your site.

Solution #3: Create a new .htaccess file

Create new .htaccess file
Image Source: StartupStockPhotos – Pixabay.com / License: CC0 Public Domain

Access your site’s root directory through File Manager or an FTP client. Look for a file called .htaccess. If you don’t see it, make sure File Manager or the FTP client you’re using is set to make hidden files viewable. FileZilla, for example, has a setting called “Force Showing Hidden Files” under the Server menu. After you’ve enabled this, you should be able to see the .htaccess file.

Once you can see the .htaccess file, rename it to .htaccess.bak to intercept WordPress’ access to it. Refresh your site in your browser to see if the 500 internal server error goes away. If it does, it was being caused by a corrupted .htaccess file.

You still need this file, however, so head to the Permalinks settings page in your WordPress dashboard. Scroll down to the bottom of the page, and click “Save Changes” to generate a new .htaccess file for your site. You can delete the one we renamed before.

Solution #4: Fix corrupted WordPress core files

Fix WordPress Files
Image Source: 27707 – Pixabay.com / License: CC0 Public Domain

Sometimes files in your wp-admin and wp-includes folders can become corrupted for a number of different reasons. Whatever the cause may be, all you know is that corrupted file is now generating a 500 internal server error on your site.

A quick and easy fix is to upload new wp-admin and wp-includes folders to your site and overwrite the originals. Just download a fresh version of WordPress by clicking the download button here. There’s a “Release Archive” link in the menu on the left-hand side of the page if you don’t have the latest version of WordPress installed.

Extract the folder once it’s finished downloading, and open the inner folder named wordpress. Copy the wp-admin and wp-includes folders from the wordpress folder over to your site’s root directory, and overwrite the original folders when File Manager or your FTP client asks you if you’d like to. Don’t forget to enter the correct data in the file wp-config.php to connect WordPress to your database.

Once that is done, refresh your site to see if it’s still generating a 500 internal server error. If it’s not, the error was being caused by a corrupted WordPress core file.

Final thoughts & other solutions for this common WordPress issue

Final thoughts and solutions
Image Source: fancycrave1 – Pixabay.com / License: CC0 Public Domain

The 500 internal server error issue can be a tricky issue to solve, but we hope these solutions have helped you narrow down the problem. There are a few other solutions you can try. For example, your server may generate this error if you exceed the PHP memory limit of your site. If that’s the case, you’ll want to increase your limit by using:

define('WP_MEMORY_LIMIT', '64M');

at the top of your wp-config.php file and changing the 64M unit to a number that’s higher than your current PHP memory limit. You can also ask your host to do this for you.

You can also debug your site to look for PHP error logs that may be generating the 500 internal server error, deactivate your WordPress theme, check your file permissions and check your PHP version to see if plugins you’re using require a newer version of PHP. Do you have any questions or other suggestions to solve this error? Just let us know in the comments below.

Share this with your friends

8 Comments

  1. Hello, my site gave me a 500 error. I contacted GoDaddy (hosting service) for assistance. Their tech support gave the following diagnosis:

    “We found multiple issues. In regards to the internal server error, this error was actually occurring because the path in the .user.ini file was incorrect. After updating this path and moving the file to the root directory we found the site was resolving again. We found the reason for this error after enabling detailed errors.”

  2. Hi, I have a problem with my website. I’m getting this error:

    Internal Server Error: The server encountered an internal error or misconfiguration and was unable to complete your request.
    
    Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.

    What can I do to resolve this issue with my website?

    • Hi Sergio, this is exactly the kind of error which is covered in our article. You could perform the mentioned steps and try to solve your issue or contact your hosting company for further analysis and support. Your host should be able to see where this error is coming from.

  3. I just wanted to install a WordPress theme by uploading the zip in the dashboard panel but I got an error: “The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, and inform them of the time the error occurred,and anything you might have done that may have caused the error.”

    After that my site has an error 502. What should I do now? How to access my panel? And how to install my WordPress theme?

    • Hi Aneta, uploading WordPress themes via the WordPress dashboard is core functionality which should work absolutely fine if WordPress is installed correctly and fully supported by your hosting company. In the end this can have many reasons and needs to be analyzed properly.

      We can only recommend that you contact your hosting company for further analysis because it’s very likely that there are misconfigurations on the server. For example the 502 error usually means that the server is down or not configured correctly in order to process the request.

  4. Hello, today I wanted to customize my website and I’m receiving a 500 Internal Error. What does this mean?

    Incorrect file/directory permissions: Above 755.
    In order files to be processed by the webserver, their permissions have to be equal or below 755. You can update file permissions with a FTP client or through cPanel's File Manager.
    
    Incorrect Apache directives inside .htaccess file.
    Make sure you have not specified unsupported directives inside the local .htaccess file. Such include PHP settings and Apache module settings.
    • Hi Leona, it seems there are various issues with the configuration on your server. If you’re not familiar with changing file permissions or modifying .htaccess files on your server, then please contact your hosting company for further analysis and support.

Leave a Comment

Your email address will not be published.


*