Skip to content
The site is down

500 error on a WordPress site

“Internal Server Error” tells you little. On WordPress it can be a plugin, a mistake in .htaccess or the memory limit.

You need
FTP
Updated

A 500 error means the server received a request it couldn't complete, and the error page doesn't say why. On a WordPress site the cause can be a plugin that triggers a fatal PHP error, a mistake in the rewrite rules, or PHP running out of memory.

The cause is nearly always in an error log, so you can either read the log or rule out the three causes one by one.

See where the error happens

  1. Open the front page, an inner page and /wp-admin in a private window.
  2. If it says "There has been a critical error on this website", WordPress caught the error. Start with the plugins and the theme.
  3. If it only says "Internal Server Error" or "HTTP ERROR 500", the request failed before WordPress could display anything. In that case the fault is in the rewrite rules, in the PHP setup or at your host. Work through the steps below, and contact your hosting provider if none of them helps.
  4. Note the time. You'll need it when you search the log.

Fix it from wp-admin

If you can get into wp-admin, a plugin may be failing on certain pages only.

  1. Go to Plugins and deactivate the one you installed or updated last.
  2. Go to Settings → Permalinks and click "Save Changes" without changing anything. On Apache and LiteSpeed, WordPress then rewrites its rules in .htaccess.

Check the rewrite rules

A mistake in the rewrite rules gives a 500 error on the whole site, wp-admin included. Security and cache plugins can add rules of their own. Where the rules live depends on the web server the site runs on. If you don't know which one it is, your hosting provider can tell you.

Apache and LiteSpeed read the rules from .htaccess in the WordPress root folder, where wp-config.php is.

  1. Connect with FTP or the file manager in your hosting panel, and open the root folder.
  2. Rename .htaccess, for example to .htaccess-old. If you can't see the file, enable hidden files in your FTP client or file manager.
  3. Reload the site. If it works now, .htaccess was the problem.
  4. Log in and save the permalinks again, so WordPress writes a new file. If WordPress can't write the file, create .htaccess yourself with this default content:
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Deactivate the plugins and raise the memory limit

If fixing the rewrite rules doesn't help, rename the wp-content/plugins folder. If the site works after that, log in and open Plugins while the folder still has its new name. WordPress then deactivates all plugins. Rename the folder back to plugins, and activate the plugins one by one until the error returns.

If the error log says Allowed memory size of … bytes exhausted, add this line to wp-config.php, just above the line with require_once ABSPATH . 'wp-settings.php';:

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

Read the error log in the hosting panel

Most hosting panels have an error log for the site. Look for lines from the time you noted. A line that mentions .htaccess points to that file. A line with PHP Fatal error shows the file and line where the error occurred, and the folder name tells you which plugin it is.

Many cPanel servers also write PHP errors to a file called error_log in the folder where the script ran, such as the root folder or wp-admin.

If the log says Permission denied, a file or folder has the wrong permissions. WordPress recommends 755 for folders and 644 for files. You change permissions in the file manager or in your FTP client.

Also check whether the PHP version was changed recently. Older plugins can stop working when the host upgrades PHP.

When you're stuck

If the site still gives a 500 error after you have checked the rewrite rules, turned off every plugin and raised the memory limit, the answer is in the server log. If you can't open it yourself, your hosting provider can read it for you. Send them the address and the time the error happened.