A 500 Internal Server Error means the server hit a problem it couldn’t recover from while building the page. It’s a generic message, so it doesn’t say what went wrong. On WordPress, the usual causes are a broken .htaccess file, a plugin or theme error, running out of memory, or a PHP version problem.
The good news is that the causes are limited, and you can check them in order. Take a backup first if your host lets you, then work through the steps below.
Start here: check what changed
Most 500 errors appear right after something changed. Think back to what happened just before the error:
- A plugin, theme or WordPress update.
- A new plugin installed.
- A code snippet added to
functions.php. - A PHP version change by you or your host.
- A migration, or a change to
.htaccessor server settings.
If you know what changed, start there. Undoing that one change fixes the error most of the time.
1. Read the error log
The error log usually names the exact file and line that failed, which saves a lot of guessing. Check two places.
Your server’s error log
Most hosting control panels have an Error Log or Logs section. Look for entries from the time the error appeared. Lines starting with PHP Fatal error are the most useful. A path containing wp-content/plugins/plugin-name or wp-content/themes/theme-name tells you which plugin or theme is responsible.
WordPress debug log
You can also have WordPress write its own log. Edit wp-config.php in your site’s root folder and add these lines above /* That's all, stop editing! */. If a WP_DEBUG line already exists, change it rather than adding a second one.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Reload the page that shows the error, then open wp-content/debug.log. When you’re done, set WP_DEBUG back to false and delete the log file, because it can contain information about your site.
If the log points to a specific plugin or theme, skip to that step below.
2. Reset .htaccess
On Apache and LiteSpeed servers, a bad rule in .htaccess causes an instant 500 error on every page. It can be corrupted by a plugin, a migration, or a manual edit.
- Connect with FTP or your host’s file manager and open your site’s root folder, where
wp-config.phpis. You may need to turn on showing hidden files. - Rename
.htaccessto.htaccess-old. - Load your site. If the home page works,
.htaccesswas the problem. - Log in and go to Settings → Permalinks and click Save Changes without changing anything. WordPress writes a fresh
.htaccessfile.
If you had custom rules in the old file, such as redirects or security rules, add them back one at a time from .htaccess-old.
If your server runs Nginx, there is no .htaccess and you can skip this step.
3. Disable plugins
A plugin with a fatal error is the most common cause after .htaccess. If you can’t reach the dashboard, disable all plugins over FTP:
- Open
wp-contentand rename thepluginsfolder toplugins-off. - Load your site. If the error is gone, a plugin caused it.
- Log in and open Plugins → Installed Plugins. WordPress will deactivate the missing plugins.
- Rename the folder back to
plugins, then reactivate plugins one at a time until the error returns. The last one you activated is the cause.
If the error log already named a plugin, you can just rename that one plugin’s folder instead. Our guide to troubleshooting plugin conflicts covers this in more detail.
If you have SSH and WP-CLI, you can deactivate all plugins with one command. The extra flags stop WP-CLI from loading the broken code:
wp plugin deactivate --all --skip-plugins --skip-themes
4. Switch the theme
If plugins aren’t the cause, test the theme. In wp-content/themes, rename your active theme’s folder, for example my-theme to my-theme-off. WordPress will fall back to a default theme such as Twenty Twenty-Five if one is installed. If the error goes away, the theme, or code added to its functions.php, is the problem.
Custom code snippets are a common cause here. A single missing bracket in functions.php takes the site down.
5. Increase the PHP memory limit
If the log shows Allowed memory size of ... bytes exhausted, PHP ran out of memory. Add this to wp-config.php above the “stop editing” line:
define( 'WP_MEMORY_LIMIT', '256M' );
WordPress can’t raise memory above the limit your host allows, so if that doesn’t help, ask your host to raise PHP’s memory_limit. Our guide to the WordPress memory limit has the full details.
6. Check the PHP version
If the error started after a PHP upgrade, an older plugin or theme may use code that newer PHP versions no longer support. Errors mentioning Uncaught Error, undefined function or a deprecated feature after an upgrade point to this.
Most hosts let you change PHP version per site in the control panel. Switching back to the previous version will usually bring the site back. Treat that as a short-term fix: update or replace the plugin or theme that doesn’t support the newer version, then switch forward again.
The reverse can happen too. Current plugins may require a newer PHP version than your server runs. WordPress itself recommends PHP 8.x.
7. Check file permissions
Some servers return a 500 error if files or folders have the wrong permissions, especially if they are set too open, like 777. The standard WordPress permissions are:
- Folders:
755 - Files:
644 wp-config.php:640or600if your host supports it, otherwise644
You can check and change these in your FTP client or file manager. With SSH, these commands reset folders and files from inside your site’s root folder:
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
8. Replace WordPress core files
If nothing above works, a core file may be damaged, for example after an interrupted update. You can replace the core files without touching your content. With WP-CLI:
wp core download --skip-content --force
This keeps wp-config.php and wp-content as they are. Without WP-CLI, download WordPress from WordPress.org and upload everything except the wp-content folder, overwriting the existing files.
Related errors
Since WordPress 5.2, many PHP fatal errors show “There has been a critical error on this website” instead of a 500. See our guide to handling a WordPress critical error. A completely blank page is covered in our white screen of death guide.
Keep it from happening again
- Test updates and PHP changes on a staging copy before applying them to the live site.
- Keep automatic backups so you can roll back quickly.
- Remove plugins you no longer use, especially ones that haven’t been updated in a long time.
Need it fixed now?
If your site is showing a 500 error and you’d rather not dig through logs and FTP, our $79 one-time fix will find the cause and get it back online. It’s fixed or your money back, usually within 24 hours. To stop it happening after the next update, our Care Plans test updates on staging first.