How to Fix the 500 Internal Server Error in WordPress

← Back to all WordPress fixes

Introduction

The 500 Internal Server Error is one of the most frustrating problems in WordPress — not because it’s hard to fix, but because it tells you almost nothing. There’s no clue on the page about what went wrong, just a generic message (or a blank screen) from your server. The error means something failed on the server side while loading your site, and WordPress couldn’t finish the request.

The upside: the list of likely causes is short, and you can work through them in order until your site comes back. Here’s how.

What Causes a 500 Internal Server Error?

In WordPress, a 500 error almost always traces back to one of these:

  • A corrupted .htaccess file
  • A plugin or theme conflict, or faulty custom code
  • An exhausted PHP memory limit
  • Corrupted core files, often from an interrupted update
  • An incompatible PHP version

Because the cause is hidden, the fastest approach is to rule them out one by one, starting with the most common.

Before You Start: Back Up and Turn On Error Logging

Two quick preparations make this far safer and faster. First, if you can, take a backup of your site (or at least your wp-config.php and .htaccess) so you can revert any change. Second, enable WordPress debugging so the server tells you the actual error instead of a generic 500. Add this to wp-config.php:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );

Errors are then written to /wp-content/debug.log, which often points straight at the offending plugin or file. Remember to turn debugging off again once you’re done.

Step 1: Regenerate the .htaccess File

A corrupted .htaccess is the most common cause. Using FTP or your host’s File Manager, find .htaccess in your site’s root folder and rename it to .htaccess_old. Reload your site — if it works, the file was the problem. To generate a fresh one, log in to WordPress and go to Settings → Permalinks and click Save Changes (you don’t need to change anything). WordPress writes a clean .htaccess automatically.

Step 2: Deactivate All Plugins

If .htaccess wasn’t it, a plugin conflict is the next most likely cause. If you can’t reach wp-admin, deactivate them via FTP: rename the /wp-content/plugins folder to plugins_old. Reload your site — if it’s back, a plugin was the cause. Rename the folder back to plugins, then reactivate plugins one at a time, reloading after each, until the error returns and reveals the culprit.

Step 3: Switch to a Default Theme

If plugins aren’t the issue, test your theme. Rename your active theme’s folder inside /wp-content/themes; WordPress falls back to a default theme (like Twenty Twenty-Four). If the error clears, the theme — or a recent edit to it, such as a mistake in functions.php — is responsible.

Step 4: Increase the PHP Memory Limit

A site that runs out of memory can throw a 500 error. Try raising the limit by adding this to wp-config.php, above /* That’s all, stop editing! */:

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

If your host caps memory at the server level, you may need to ask them to raise it — many will on request.

Step 5: Re-Upload Core WordPress Files

If nothing above works, core files may be corrupted. Download a fresh copy of WordPress from WordPress.org, and via FTP re-upload the wp-admin and wp-includes folders, overwriting the existing ones. This replaces any damaged core files without touching your content, themes, or plugins in wp-content.

Step 6: Check Your PHP Version

An outdated — or, occasionally, a too-new — PHP version can break older plugins or themes and surface as a 500 error. In your hosting control panel, check which PHP version your site runs and try switching to a current, stable release (PHP 8.x). If the error appeared right after your host changed PHP versions, this is likely the cause.

Step 7: Restore From a Backup

If the 500 error started right after an update, a migration, or a manual edit, the quickest fix is often to restore the backup you had from just before — rather than chasing the exact broken file. If the error also blocks wp-admin, you’re still covered: Emergency Recovery restores your site without a working dashboard, and an automatic before-update backup gives you a clean snapshot to roll back to.

Related WordPress Errors

A 500 error is sometimes confused with other failures that look similar. If your symptoms don’t quite match, these guides may help:

Frequently Asked Questions

Why is the 500 error so vague?
By design — the server hides the technical details from visitors for security. Enabling WP_DEBUG (above) reveals the real error in a log file so you can pinpoint the cause.

Will I lose content while fixing it?
The fixes here — renaming .htaccess, deactivating plugins, re-uploading core — don’t touch your posts or pages, which live in the database. A backup is still your safest guarantee.

It works again after deactivating plugins — now what?
Reactivate them one by one until the error returns. The last plugin you switched on is the conflict; update it, replace it, or contact its developer.

How do I prevent 500 errors from updates?
Take an automatic backup before every update and test major changes on a staging site first, so a bad update never reaches live unchecked.

Conclusion

A 500 Internal Server Error feels opaque, but it’s really just the server’s way of saying “something failed and I couldn’t recover.” Work through the causes in order — .htaccess, plugins, theme, memory, core files, PHP version — and you’ll almost always find the culprit. And with a recent backup ready, even the trickiest case has an instant way out.

Turn server errors into a quick restore

With automatic, off-site backups from Nota Backup & Restore, a 500 error is a five-minute rollback — even when you can’t log in. Start your 14-day free trial — no credit card required.