A WordPress 500 error is deliberately unhelpful. The server knows what failed, but it sends the same generic page to the visitor and often writes the useful detail only to a log file. That is why the first instinct, reinstalling WordPress, is usually the wrong one: it replaces working files while leaving the actual cause in place.

The fix is a short investigation. Find out whether the failure is site-wide or page-specific, read the log, and then remove the most likely conflict. Work on a backup or staging copy when you can, and avoid making three changes at once.

What a 500 error actually means

A 500 response means the server accepted the request but could not complete it. In WordPress, that usually points to one of these layers:

  • PHP code. A plugin, theme or core file has a syntax error, calls a missing function, or hits an incompatibility with the current PHP version.
  • Memory. PHP reached its memory limit while loading a heavy admin page, builder or import.
  • Database. WordPress cannot connect to MySQL, or a table is damaged.
  • Server configuration. A bad .htaccess rule, a PHP handler change or an exhausted hosting resource.
  • File permissions. The web server cannot read a required file.
  • Certificate or proxy. A proxy in front of the site is misconfigured and returns a 500 of its own.

Step 1: Define the blast radius

Open the site in a private window and check three things:

  1. The homepage. If it fails, the problem is probably site-wide.
  2. /wp-admin/. If the dashboard works but the front end does not, the cause is more likely a theme or a public-facing plugin.
  3. A specific post or page. If only one page fails, the content, a shortcode or a page-specific template is the likely trigger.

Also note when the error started. A 500 that appeared immediately after a plugin update, a PHP version change or a DNS cutover has an obvious place to look. One that appeared overnight with no changes is more likely to be a resource limit or a database issue.

If the site is behind Cloudflare or another proxy, check whether the 500 is coming from the origin or the proxy. The response headers and the proxy’s own error page usually make that clear.

Step 2: Read the actual error

The log is the difference between guessing and knowing. Start with the hosting control panel.

Fix Beginner5–10 minutesLow risk

Find the PHP fatal error in the hosting log

  1. Open your hosting control panel, such as cPanel, Plesk or the host’s custom dashboard.
  2. Look for Errors, Error Log, Logs or Metrics.
  3. Filter to the time the 500 started. The useful line often contains PHP Fatal error, Allowed memory size exhausted or Uncaught Error.
  4. Note the file path and line number in the message. That path usually identifies the plugin, theme or core file involved.

If the host exposes raw log files, the Apache or LiteSpeed error log and the PHP-FPM log are the most useful. A generic message such as Premature end of script headers points to a fatal PHP crash rather than a network problem.

If you cannot reach the host log, enable WordPress debugging on a staging copy or through SFTP. Add these lines to wp-config.php, above the /* That's all, stop editing! */ line:

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

Load the failing page again and check wp-content/debug.log. Keep WP_DEBUG_DISPLAY set to false so error details are not shown to visitors, and remove or disable debugging once the issue is resolved.

Step 3: Disable plugins and switch the theme

If the log points to a plugin, or you cannot get a log, isolate the conflict by removing code from the request. WordPress loads plugins before the theme, so start there.

Fix Intermediate5 minutesLow risk

Disable all plugins without losing their settings

  1. Connect to the site with SFTP or the hosting File Manager.
  2. Open the wp-content folder.
  3. Rename plugins to plugins-disabled.
  4. Reload the site. WordPress will show a notice that plugins are disabled, but the site should load if a plugin was the cause.
  5. Rename the folder back to plugins, then deactivate plugins one at a time from the dashboard until the 500 returns.

If you have SSH access and WP-CLI, you can do the same without touching folders:

wp plugin list
wp plugin deactivate --all

If the site still fails with every plugin disabled, switch the theme to a default one. Rename wp-content/themes/your-theme to your-theme-disabled; WordPress falls back to an available default theme. If that restores the site, the problem is in the theme or a child theme file.

Once you identify the culprit, do not simply leave it disabled forever. Update it, replace it, or restore its settings from a backup. A disabled security or caching plugin can create a different problem later.

Step 4: Check memory and PHP limits

The log line Allowed memory size of X bytes exhausted is common on page builders, large imports and busy admin screens. WordPress may also show the generic critical error page when it cannot allocate memory.

Fix Intermediate10 minutesModerate risk

Raise the PHP memory limit safely

  1. Open wp-config.php through SFTP or the File Manager.

  2. Find the line /* That's all, stop editing! Happy publishing. */.

  3. Add this line above it:

    define( 'WP_MEMORY_LIMIT', '256M' );
  4. Save the file and reload the site.

  5. If the host caps PHP memory below 256 MB, ask support to raise the account limit. A WordPress constant cannot override a server-level hard limit.

Do not set the value to an arbitrary huge number. A site that needs several gigabytes per request usually has a plugin or query problem, not a memory-limit problem.

While you are in the hosting panel, confirm the PHP version. A plugin written for PHP 7.4 may throw fatal errors on PHP 8.3, and an old theme may do the same. If the error began after a PHP upgrade, switching back to the previous version temporarily is a reasonable way to confirm the cause, but plan the plugin updates rather than staying on an unsupported PHP release.

Step 5: Reset .htaccess and check permissions

If the log is empty and plugins and themes are ruled out, the web server configuration is the next layer. A corrupted .htaccess file can produce a 500 before WordPress even runs.

Fix Intermediate5 minutesLow risk

Rebuild the WordPress rewrite rules

  1. Connect with SFTP and download a copy of .htaccess from the WordPress root.
  2. Rename the live file to .htaccess-backup.
  3. Reload the site. If it loads, the old rules were the problem.
  4. In WordPress, open Settings > Permalinks and select Save Changes without altering the settings. WordPress writes a fresh .htaccess.
  5. If you use a security or caching plugin that adds rules, re-enable it and confirm the site still loads.

If the site is on Nginx, there is no .htaccess; ask the host to check the server block instead.

File permissions are the other common configuration cause. Directories should generally be 755 and files 644; wp-config.php can be stricter. A file set to 600 may be readable by the owner but not by the web server process, which produces a 500 or a blank page.

Step 6: Check the database

A database failure often produces a different error, but a damaged table or an exhausted connection limit can surface as a 500. Look for Error establishing a database connection or MySQL server has gone away in the log.

  • Confirm the database host, name, user and password in wp-config.php have not changed.
  • Ask the host whether the account hit its database connection or disk quota.
  • Use phpMyAdmin or WP-CLI to check and repair tables only after taking a backup.
wp db check
wp db repair

Do not run a repair on a production database while you are unsure of the cause. If the host provides a one-click restore, a clean restore is often faster and safer than improvising SQL.

Step 7: Restore from backup when the cause is not clear

If the site is down and you cannot get log access, restore the most recent backup that predates the failure. A restore is not a defeat; it is the controlled option when the alternative is editing production files blindly.

Before restoring, save the current wp-content folder and a database export if the host allows it. That gives you evidence to investigate later and a way to recover any content created after the backup.

Check whether the fix worked

  • Open the homepage, a single post and /wp-admin/ in a private window.
  • Confirm the HTTP status is 200, not 500, in the browser’s network panel or with curl -I https://your-site.example/.
  • Submit a test form or load the page that originally failed.
  • Check the error log again after ten minutes. A clean request should not add new fatal errors.
  • If you disabled plugins, re-enable them one by one and retest after each.

Prevent it from happening again

  • Update on a staging copy first. Test plugin, theme and PHP changes before they reach production.
  • Keep a restorable backup. Files and database, stored somewhere other than the same server.
  • Watch the error log after changes. The first warning is cheaper than the outage.
  • Remove abandoned plugins and themes. An unmaintained plugin is a common source of PHP 8 incompatibilities.
  • Do not edit theme files directly. Use a child theme or a code snippets plugin with a rollback path.
  • Set a memory limit that matches the host. Coordinate with support rather than guessing at constants.