WP AI Agent
Features Pricing Blog Contact Download Plugin Manage Subscription Get Free Key →

How to Fix the WordPress 500 Internal Server Error (Complete Guide)

· · 9 min read

The WordPress 500 internal server error is one of the most common — and most alarming — problems you can encounter on your website, appearing with no clear explanation and taking your entire site offline. Unlike errors that tell you exactly what went wrong, the 500 error is a generic HTTP status code that simply means something went wrong on the server, but it refuses to tell you what. The good news is that there are a finite number of causes, and this guide will walk you through every one of them methodically until your site is back online.

What Causes the WordPress 500 Internal Server Error?

Before diving into fixes, it helps to understand the most common culprits. The 500 error is a catch-all response, so the root cause could be hiding in several different places.

  • Corrupted .htaccess file — the most common cause on Apache servers
  • PHP memory limit exhaustion — your site runs out of allocated memory mid-process
  • Faulty plugin or theme — poorly coded extensions crash PHP execution
  • Corrupted WordPress core files — core files get modified or become corrupted
  • Incompatible PHP version — your host upgraded PHP and a plugin broke
  • Server-side issues — database server is down or misconfigured

Identifying which category your problem falls into is the first step. Work through the sections below in order, as they are arranged from most likely to least likely cause.

Step 1: Check and Fix Your .htaccess File

A corrupted or malformed .htaccess file is responsible for the WordPress 500 error more often than any other single cause. This file controls how Apache handles requests, and even a single bad character can bring down your whole site.

How to Reset the .htaccess File

  1. Connect to your server using an FTP client (such as FileZilla) or your host's file manager.
  2. Navigate to the root directory of your WordPress installation (the folder containing wp-config.php).
  3. Locate the file named .htaccess. Note: you may need to enable hidden files in your FTP client (in FileZilla go to Server > Force Showing Hidden Files).
  4. Download a backup copy of the file to your local computer before making any changes.
  5. Delete the .htaccess file from the server — or rename it to .htaccess_old.
  6. Visit your website. If it loads, the .htaccess file was the problem.
  7. To generate a fresh, clean file, log in to your WordPress dashboard, go to Settings > Permalinks, and click Save Changes without changing anything. WordPress will write a new .htaccess automatically.

What a Clean WordPress .htaccess Looks Like

If you prefer to manually create the file, paste the following default WordPress content into a new .htaccess file and upload it to your root directory:

# BEGIN WordPress

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

# END WordPress

Step 2: Increase the PHP Memory Limit

WordPress needs a minimum amount of PHP memory to run. If your hosting plan sets this limit too low, complex operations — like running WooCommerce, loading a page builder, or handling a large query — will exhaust the available memory and trigger a 500 error.

Increasing Memory via wp-config.php

  1. Connect to your server via FTP or SSH.
  2. Open the file wp-config.php located in your WordPress root directory.
  3. Find the line that reads /* That's all, stop editing! Happy publishing. */
  4. Immediately above that line, add the following:
define( 'WP_MEMORY_LIMIT', '256M' );
  1. Save the file and upload it back to the server.
  2. Reload your website to see if the error is resolved.

Increasing Memory via php.ini or .htaccess

If the wp-config.php method does not work because your host restricts it, you can try adding the following to your .htaccess file or to a php.ini file in your root directory:

; In php.ini
memory_limit = 256M

# In .htaccess
php_value memory_limit 256M

Note that some managed hosting environments will override these values. In that case, contact your host and ask them to raise the PHP memory limit directly on the server level.

Step 3: Deactivate All Plugins

If your dashboard is accessible, deactivate plugins through Plugins > Installed Plugins. However, a 500 error often means you cannot access your dashboard at all. In that case, use one of the methods below.

Deactivating Plugins via FTP

  1. Connect to your server via FTP.
  2. Navigate to wp-content/plugins/.
  3. Rename the entire plugins folder to plugins_disabled. WordPress will no longer find any plugins and will silently deactivate them all.
  4. Reload your website. If it loads, a plugin was the cause.
  5. Rename the folder back to plugins.
  6. Re-enable plugins one at a time — rename each individual plugin subfolder back to its original name and reload the site after each one until you find the culprit.
  7. Once identified, delete or replace the faulty plugin.

Deactivating Plugins via WP-CLI

If you have SSH access and WP-CLI installed, you can deactivate all plugins with a single command:

wp plugin deactivate --all

To reactivate them one by one and test each one:

wp plugin activate plugin-folder-name

Step 4: Switch to a Default Theme

Just like plugins, a poorly coded or corrupted theme can throw a 500 error. If deactivating plugins did not solve the problem, your theme is the next suspect.

Switching Themes via FTP

  1. Connect via FTP and navigate to wp-content/themes/.
  2. Rename your active theme folder (for example, rename my-custom-theme to my-custom-theme-old).
  3. WordPress cannot find the active theme and will automatically fall back to a default theme (such as Twenty Twenty-Four) if one is installed.
  4. Reload your website. If it works, your theme was the problem.
  5. Check the theme developer's website for updates, or contact their support team.

Switching Themes via WP-CLI

wp theme activate twentytwentyfour

Step 5: Enable WordPress Debugging to Find the Real Error

WordPress ships with a built-in debugging mode that can reveal the actual PHP error hiding behind the generic 500 message. Enabling it is one of the fastest ways to pinpoint the exact file and line number causing the crash.

How to Enable WP_DEBUG

  1. Open wp-config.php via FTP.
  2. Find the line define( 'WP_DEBUG', false ); and change it to the following block:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
  1. Save the file and upload it back to the server.
  2. Reload the page that was showing the 500 error.
  3. Navigate to wp-content/debug.log in your FTP client and download it.
  4. Open the log file — it will contain specific PHP errors, file paths, and line numbers pointing directly to the problem.
  5. Important: Once you have fixed the issue, set WP_DEBUG back to false. Leaving it enabled on a live site is a security risk.

Check Server Error Logs

Your hosting control panel (cPanel, Plesk, etc.) also stores server-level error logs that may contain additional information. In cPanel, go to Metrics > Errors to view recent PHP and Apache errors. These logs often contain the exact error message that was suppressed from the browser.

Step 6: Re-upload WordPress Core Files

If none of the above steps resolved the error, your WordPress core files may be corrupted. This can happen after a failed update, a partial file upload, or a malware infection.

How to Re-upload Core Files Safely

  1. Download a fresh copy of WordPress from wordpress.org/download matching your current version number.
  2. Extract the ZIP file on your local computer.
  3. Delete the wp-content folder from the extracted files — this folder contains your themes, plugins, and uploads and must not be overwritten.
  4. Connect to your server via FTP.
  5. Upload all the remaining files from the fresh WordPress download to your server root, overwriting existing files when prompted.
  6. Reload your website.

Re-uploading Core Files via WP-CLI

If you have SSH access, WP-CLI makes this even easier and safer:

wp core download --skip-content --force

The --skip-content flag ensures your wp-content folder is untouched, and --force overwrites existing core files with fresh copies.

Frequently Asked Questions

Why does the 500 internal server error happen only on certain pages?

A page-specific 500 error usually points to a problem with that page's content, a shortcode from a specific plugin that is failing, or a custom query that is exceeding the memory limit. Enable WP_DEBUG and visit the affected page to capture the exact error in the debug log, then check which plugin or theme function is responsible.

Can a 500 error be caused by my hosting provider?

Yes. Occasionally the error originates entirely on the server side — for example, if the MySQL database server goes down, if your host enforces strict resource limits, or if there is a misconfiguration after a server migration. If you have ruled out all WordPress-side causes, contact your hosting support team and ask them to check the server error logs on their end.

Is the WordPress 500 error the same as a white screen of death?

They are closely related but not identical. The White Screen of Death (WSOD) is a blank white page with no HTTP error code, while a 500 Internal Server Error displays an explicit error message or status code. Both are typically caused by PHP fatal errors, and the same troubleshooting steps — checking plugins, themes, memory limits, and debug logs — apply to both.

Will fixing the 500 error delete any of my data?

None of the steps in this guide delete your posts, pages, media, or database data. Re-uploading core files does not touch your wp-content folder. Renaming plugin and theme folders via FTP simply deactivates them — it does not uninstall them or remove their data from the database. Always take a full backup before making changes, but rest assured these fixes are non-destructive.

Dealing with a WordPress 500 internal server error can feel overwhelming, but working through each potential cause systematically — from the .htaccess file to core file integrity — will get your site back online. If you want a faster, hands-free way to troubleshoot and fix WordPress errors in the future, WP AI Agent is a powerful tool that lets you diagnose and resolve issues like these through a simple natural-language AI chat interface, without ever needing to touch an FTP client or edit configuration files manually.

Ready to manage WordPress with AI?

Get 100,000 tokens free every month. No credit card required.

Get Your Free License Key →

More from the blog