WP Umbrella Logo

How to Fix The HTTP 500 Internal Server Error on WordPress

The WP Umbrella Team

Are you trying to resolve the HTTP 500 internal server error on WordPress?

The 500 internal server error on WordPress is probably one of the worst you can encounter because it takes down your entire site. Often, these internal server errors are the consequence of a mistake in the PHP code.

But you never wrote a single line of code, so how could an error like this happen?

Every time you add a theme or plugin to your WordPress site, you’re actually adding lines of code. This can, among other things, crash your entire WordPress website.

500 error code message

In this article, I’ll explain what the 500 internal server error is and how to fix it!

What is the HTTP 500 Internal Server Error on WordPress?

The 500 error is a server-side issue

The HyperText Transfer Protocol (HTTP) 500 Internal Server Error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This error response is a generic “catch-all” response. Usually, this indicates the server cannot find a better 5xx error code to response.

Source : Mozilla Dev Blog

This error belongs to the 5xx status code family.

This category of status code refers to internal server errors. They occur when a server is unable to fulfill an apparently valid request.

That means something has gone wrong on the website’s server, but the server can’t be more specific about what the issue is.

Other Server-Side Errors You Might Encounter

  • The 502 Bad Gateway error indicating that one server received an invalid response from another server;
  • The 503 Service Unavailable error indicating that the site’s server is not available at the moment (and that’s why you should monitor your uptime on WordPress)
  • The 504 Gateway Timeout error appearing in situations where the link between two web servers is to slow.

Secure your website with automated backups, comprehensive monitoring and secured updates.

Install WP Umbrella on your websites in a minute and discover a new way to manage multiple WordPress sites.

Get Started for free

Common Triggers for HTTP 500 Internal Server Errors on WordPress

Understanding why a 500 error happens is the first step in fixing it. Since this is a server-side issue it’s most likely to be triggered by:

Request entity too large error
  • A WordPress update;
  • A theme or plugin update or install;
  • A modification of your server configuration (PHP version, etc.);
  • If you exceed the PHP memory limit of your server.

A Step-by-Step Guide to Fixing HTTP Error 500 on WordPress

Fixing this issue can be challenging since the 500 error never points to a clear cause. However, here’s my troubleshooting checklist:

1. Manually Remove plugins and themes

It is likely that the 500 error you are encountering is a consequence of the last theme or plugin you installed or updated. So, the first thing to do is to remove them.

How to manually remove a plugin or theme if my website is down?

Easier said than done because your site is down and you can’t access the WordPress Admin Dashboard so how do you do that?

connecting to FTP client

You first need an FTP Client. I personally use Filezilla. The software if free and safe.

To use Filezilla and connect to your website, you will need to enter your FTP address, username, and password.

If you don’t know your credential, then check the first emails your hosting company sent you when you signed up. It usually contains your FTP username and password. If you don’t find it, reach out to your hosting support.

deleting useless plugin

Once you are connected, you need to go to /www/wp-content/plugins/ folder.

Then click right on your plugin, and click on delete. Erase one plugin, go back to your browser web, and open a private navigation window.

If this doesn’t work, go to the next step!

2. Restore Corrupted .htaccess File

Sometimes, plugins and themes can also corrupt your .htaccess file, causing the 500 Internal Server Error.

In order to restore your .htaccess file your need to access your WordPress Root directory with your FTP Client (see above).

editing .htaccess file

Then, download the file named .htaccess and open it with your favorite HTML editor.

Delete the contents of the file and copy/paste the code below instead.

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Save the file upload it, and reload your website to see if the issue is fixed. If it is not, then navigate to the next step.

3. Increase PHP Memory Limit

Another way of fixing the 500 internal server error is by increasing the PHP Memory Limit in WordPress.

To increase your PHP Memory Limit in WordPress you need to edit the function.php file by adding these 3 lines of code:

@ini_set(‘upload_max_size’ , ’64M’);
@ini_set(‘post_max_size’, ’64M’);
@ini_set(‘max_execution_time’, ‘300’);

Function.php is also located in WordPress Root Directory.

You can access and edit the file with your FTP client in the same way as the .htaccess file (see above).

Resolving The 500 Internal Server Error on WordPress: Final Thoughts

This problem is really annoying because it affects every page of your website, so you need to fix it quickly. Yet, the 500 Server Error code is vague and not helping much.

If the tips I provided you in this article don’t work, reach out to your hosting provider ASAP.

Also, keep in mind that you are always better safe than sorry and one of the best not to trigger 500 internal server errors is to monitor WordPress PHP error logs and get rid of the plugins that are not strictly essential to your website!