Skip to content
General

How to Fix a 500 Internal Server Error in WordPress

A 500 Internal Server Error is a generic server failure. This guide shows how to find the real cause in WordPress and fix it step by step.

By Tremhost Experts Updated November 5, 2026 5 min read

A 500 Internal Server Error means the web server hit a problem it could not describe more precisely, so it returned a generic error instead of your page. On WordPress sites the usual causes are a faulty plugin or theme, a broken .htaccess file, a PHP memory limit that is too low, or a PHP version mismatch. The steps below check each cause in turn, starting with the quickest.

What a 500 error actually tells you

HTTP status codes in the 500 range mean the problem is on the server, not on the visitor’s device or connection. A 500 code is the catch-all: the server knows something went wrong but does not say what. That vagueness is deliberate. Detailed error messages shown to the public could reveal information useful to attackers.

The real cause is almost always written somewhere you can read it. So the first job is to find the error log, not to start changing things at random.

Step 1: Check the error logs

Logs often name the exact file and line that failed. Look in these places:

  • cPanel Errors or Metrics section – shows recent web server errors for your account.
  • error_log files – PHP often writes a file called error_log in the folder where the error happened, such as your site root or wp-admin.
  • WordPress debug log – add define(‘WP_DEBUG’, true); and define(‘WP_DEBUG_LOG’, true); to wp-config.php, reload the page, then read wp-content/debug.log. Also add define(‘WP_DEBUG_DISPLAY’, false); so errors are not shown to visitors. Switch debugging off when you are done.

If the log names a plugin or theme folder, go straight to Step 3.

Step 2: Rebuild the .htaccess file

On Apache and LiteSpeed servers, a single bad line in .htaccess can bring the whole site down. This often happens after a plugin writes its own rules.

  1. In File Manager or FTP, find .htaccess in your site root. You may need to turn on “show hidden files”.
  2. Rename it to something like .htaccess-old.
  3. Reload your site. If it works, the old file was the cause.
  4. Log in to WordPress, go to Settings > Permalinks and click Save Changes. WordPress writes a fresh, clean .htaccess file.

Step 3: Deactivate plugins and switch theme

A plugin or theme that conflicts with another, or with your PHP version, is the most common cause after an update.

  • If you can reach wp-admin: deactivate all plugins, check the site, then reactivate them one at a time until the error returns. The last one you turned on is the culprit.
  • If you cannot reach wp-admin: rename the wp-content/plugins folder to plugins-off. WordPress will deactivate every plugin. If the site loads, rename the folder back and rename individual plugin folders one at a time to find the faulty one.

For themes, rename your active theme’s folder inside wp-content/themes. WordPress falls back to a default theme if one is installed. If the error goes away, the theme needs updating or replacing.

Step 4: Raise the PHP memory limit

If the log mentions “Allowed memory size exhausted”, WordPress ran out of PHP memory. Add this line to wp-config.php above “That’s all, stop editing”: define(‘WP_MEMORY_LIMIT’, ‘256M’);

WordPress cannot go above the limit your host sets for PHP. On cPanel you can often raise memory_limit under Select PHP Version > Options or the MultiPHP INI Editor. If memory keeps running out, a plugin may be leaking memory, or the site may simply need a bigger plan.

Step 5: Check the PHP version

Old plugins can break on new PHP versions, and new plugins may need a newer PHP version than your site runs. If the error started just after a PHP change or a plugin update, try switching PHP versions in cPanel. Our guide on how to change your PHP version shows where the setting is. Treat moving to an older version as a short-term fix. Update or replace the plugin that needs it.

Step 6: Check file permissions

Wrong permissions can stop the server from running files. The usual WordPress settings are 755 for folders and 644 for files. wp-config.php can be stricter, such as 640 or 600, if your host supports it. Never set files or folders to 777.

Step 7: Re-upload WordPress core files

If none of the above helps, a core file may be damaged by a failed update or by malware. Download a fresh copy of WordPress from wordpress.org and upload the wp-admin and wp-includes folders over the existing ones. Do not overwrite wp-content or wp-config.php.

Step 8: Ask your host

Some causes are outside your account. Examples are a server misconfiguration, a security rule blocking a request, or hitting account resource limits. Send your host the exact time of the error and the URL you were loading. That makes it much quicker for them to find the matching log entry.

How to prevent 500 errors

  • Take a backup before every update. See how to take a backup.
  • Test plugin, theme and PHP updates on a staging copy before applying them to the live site.
  • Keep the number of plugins low and remove ones you no longer use.
  • Watch your hosting resource usage, so you upgrade before limits cause errors.

Frequently asked questions

Is a 500 error my fault or the host’s?

It can be either. On WordPress sites the cause is usually inside the site: a plugin, theme, .htaccess rule or memory limit. If none of those is to blame, or many sites on the same server fail at once, the problem is likely on the server and your host needs to look at it.

Can visitors fix a 500 error by refreshing?

Sometimes a temporary overload clears and a refresh works. But if the error is caused by code or configuration, it will stay until the site owner fixes it.

Does a 500 error hurt my search rankings?

A short outage is unlikely to matter. If search engines keep getting 500 errors over a longer period, they may crawl the site less often and could eventually drop affected pages. Fix the cause quickly.

What is the difference between a 500 and a 503 error?

A 500 means an unexpected failure. A 503 means the server is temporarily unavailable, often because of maintenance or overload, and should recover on its own.

Next step

If you want fewer surprises after updates, Tremhost Managed WordPress tests updates on staging before they go live and keeps daily backups so a bad change can be rolled back.

Ask us on WhatsApp