Fixing the WordPress 500 internal server error
How to diagnose and resolve the WordPress 500 internal server error by enabling debug mode, resetting .htaccess, increasing memory limits, disabling plugins and repairing the database.
Fixing the WordPress 500 internal server error
The 500 internal server error is one of the most frustrating WordPress issues because the error message itself tells you almost nothing. You'll see a generic "Internal Server Error" or "500" page, or in some cases just a blank white screen with no message at all.
What's actually happening is that something on the server has failed, but the server can't identify the specific problem well enough to show a more helpful error. In WordPress, the most common causes are a corrupted .htaccess file, a plugin or theme conflict, insufficient PHP memory, incorrect file permissions, a corrupted database table or a server-level misconfiguration.
The approach below works through each possibility in order, starting with the quickest checks and moving on to more involved fixes.
Check with your hosting provider first
Before making any changes to your site, check your hosting provider's status page and contact their support team. The 500 error may be caused by something on the server that's outside your control, such as a full disk, a crashed MySQL service, a recent PHP version change or scheduled maintenance.
Give them any error details you have and ask whether anything has changed on the server recently. This can save you a lot of unnecessary troubleshooting.
Enable debug mode
WordPress has a built-in debug mode that reveals the specific PHP error behind the generic 500 response. This is usually the fastest way to identify the cause.
Open your wp-config.php file (in the root of your WordPress installation) via FTP, SFTP or your hosting file manager. Add the following lines just above the comment that reads /* That's all, stop editing! */:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
This tells WordPress to log errors to a file rather than displaying them to visitors. Reload the page that was showing the 500 error, then check wp-content/debug.log for the output. The log will typically reference a specific file path, which tells you whether the problem is in a plugin, theme or WordPress core.
Once you've identified the error, disable debug mode by removing these lines or setting WP_DEBUG to false. Leaving debug mode enabled on a live site is a security risk, as the log file can expose sensitive information about your server configuration.
Reset .htaccess
The .htaccess file controls how your server handles URL rewriting, redirects and certain access rules. If this file has become corrupted or contains conflicting rules (often added by plugins), it can cause a 500 error across your entire site.
Connect via FTP, SFTP or your hosting file manager and rename .htaccess to .htaccess_old. Then try loading your site again. If the error clears, the file was the problem.
To regenerate a clean version, log into your WordPress dashboard and go to Settings → Permalinks, then click Save Changes without altering anything. WordPress will create a new .htaccess with the default rewrite rules.
If you can't access the dashboard, create a new .htaccess file manually using the default WordPress rewrite rules.
Note: if your server runs Nginx rather than Apache, there is no .htaccess file. Nginx uses its own configuration files, which you'll need to check with your hosting provider.
Increase the PHP memory limit
If a plugin, theme or process is using more memory than PHP has been allocated, WordPress will fail with a 500 error. You can increase the limit by adding the following line to wp-config.php:
define('WP_MEMORY_LIMIT', '256M');
If this resolves the error, it means something on your site is consuming more memory than your hosting plan's default allows. This is worth investigating rather than simply increasing the limit and moving on. Check your debug log for clues about which plugin or process is responsible. You may also need to contact your hosting provider to increase the PHP memory allocation at the server level, as the wp-config.php setting only works up to the limit your host permits.
Deactivate plugins and switch themes
Plugin and theme conflicts are among the most common causes of 500 errors, especially after an update.
If you can still access the WordPress dashboard, go to Plugins → Installed Plugins and deactivate all plugins. If the error clears, reactivate them one at a time, checking the site after each one to identify which plugin is causing the problem.
If you're locked out of the dashboard, connect via FTP or your hosting file manager and navigate to wp-content/plugins/. Rename each plugin folder one at a time (for example, change plugin-name to plugin-name-disabled) and check whether the error clears after each one.
To rule out a theme issue, rename your active theme's folder inside wp-content/themes/. WordPress will fall back to a default theme if one is installed. If the error clears, the problem is in your theme.
Check file permissions
WordPress expects files to be set to 644 and directories to 755. If permissions have been changed by a migration tool, plugin or manual edit, the server may fail to read or execute files and return a 500 error.
Check and correct permissions using your hosting file manager or an FTP client, applying 644 to files and 755 to directories recursively. Never set permissions to 777. This is a serious security risk, and many hosting providers will actively block requests to files with those permissions.
If you're not comfortable changing permissions yourself, your hosting provider can usually handle this for you.
Repair the database
A corrupted database table can trigger a 500 error, particularly if the affected table is one WordPress needs to load on every page (such as wp_options).
WordPress has a built-in database repair tool, but it's disabled by default. To enable it, add the following line to wp-config.php:
define('WP_ALLOW_REPAIR', true);
Then visit https://example.com/wp-admin/maint/repair.php (replacing example.com with your actual domain) and run the repair. This page does not require you to be logged in, which is why the feature is disabled by default and why it's important to remove the line from wp-config.php as soon as you're finished.
Restore or replace core files
If none of the above has resolved the error, WordPress core files themselves may be corrupted or incomplete. This can happen during a failed update or if files were accidentally modified.
If you can access the dashboard, go to Dashboard → Updates and click Re-install now. This replaces the core WordPress files without touching your wp-content folder (which contains your themes, plugins and uploads) or your wp-config.php file.
If you can't access the dashboard, download a fresh copy of WordPress from wordpress.org, extract it and upload the files via FTP, overwriting the existing core files. Do not overwrite wp-content or wp-config.php.
Still seeing a 500 error?
If the error persists after working through these steps, there may be a deeper server-level issue that requires access to error logs and configurations you can't reach from WordPress. My emergency WordPress support service can help diagnose and resolve persistent 500 errors.