How to Fix the 500 Internal Server Error in WordPress
Few things are more frustrating than the 500 Internal Server Error. It is the server's way of saying "something went wrong, but I have no idea what." No helpful error message, no stack trace, no pointer to the file that broke — just a generic error page. I have fixed this error more times than I can count, and the good news is that the cause is almost always one of four things.
Let me walk you through each potential cause and the exact steps to fix it.
What Causes the 500 Internal Server Error?
The 500 error is a server-side HTTP error code. It means the web server (Apache or Nginx) encountered a condition it could not handle. In WordPress, the most common causes are:
- Corrupted .htaccess file — By far the most common cause. Bad rewrite rules or conflicting directives in .htaccess crash Apache.
- PHP memory limit exceeded — A script uses more memory than allowed, and PHP dies with a 500 error instead of a proper message.
- Plugin or theme conflict — A buggy plugin or theme causes a PHP fatal error that the server cannot recover from.
- Corrupted WordPress core files — A failed update, a file permission issue, or a hacking incident can corrupt essential files.
Step 1: Check the .htaccess File
This is where I always start because it is the cause about half the time. The .htaccess file controls how Apache handles URL rewrites, redirects, and other server rules. When a plugin or a manual edit adds bad rules, it crashes the server.
- Connect to your site via FTP (I use FileZilla) or your hosting file manager.
- In your WordPress root directory, find the
.htaccessfile. Note: it is a hidden file, so make sure your FTP client shows hidden files (in FileZilla: Server → Force showing hidden files). - Rename
.htaccessto.htaccess_backup. - Create a new
.htaccessfile with the default WordPress rewrite rules:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Save the file and reload your site. If the error is gone, the old .htaccess had bad rules. You can also regenerate .htaccess from WordPress: go to Settings → Permalinks and click "Save Changes."
If the error persists, restore your backup by renaming .htaccess_backup back to .htaccess and move on to the next step.
Step 2: Increase the PHP Memory Limit
If a PHP script runs out of memory, the server may respond with a 500 error. This is especially common on shared hosting plans with low memory limits (64MB or 128MB).
Try increasing the memory limit using one of these methods:
Method 1: wp-config.php (recommended)
Add this line above the "That's all, stop editing!" comment:
define('WP_MEMORY_LIMIT', '256M');
Method 2: .htaccess
Add this line at the top of your .htaccess file:
php_value memory_limit 256M
Method 3: php.ini
Create or edit a php.ini file in your WordPress root:
memory_limit = 256M
Not all hosts support all methods. If one does not work, try the next. For a complete walkthrough, see my memory exhausted error guide.
Step 3: Disable All Plugins
A plugin conflict is one of the most common causes of the 500 error. If you can access the WordPress dashboard, go to Plugins → Installed Plugins, select all plugins, and choose "Deactivate" from the bulk actions dropdown.
If you cannot access the dashboard (more likely), disable plugins via FTP:
- Navigate to
/wp-content/. - Rename the
pluginsfolder toplugins-disabled. - Reload your site.
If the error disappears, a plugin is the culprit. Rename the folder back to plugins and reactivate plugins one by one from the dashboard. Test your site after each activation. When the 500 error returns, you have found the problematic plugin.
Common plugins that cause 500 errors include caching plugins (when they write bad .htaccess rules), security plugins (when they add complex server rules), and page builders (when they exceed memory limits).
Step 4: Switch to a Default Theme
If disabling plugins did not help, your theme might be the problem. Rename your active theme folder via FTP:
- Navigate to
/wp-content/themes/. - Rename your active theme folder (e.g.,
my-themetomy-theme-disabled). - WordPress will fall back to a default theme (like Twenty Twenty-Four).
If the site loads with the default theme, your theme has a bug. Check for available updates or contact the theme developer.
Step 5: Re-upload WordPress Core Files
If none of the above steps worked, your core WordPress files might be corrupted. This can happen after a failed update, a server crash, or a security breach.
- Download a fresh copy of WordPress from wordpress.org.
- Extract the ZIP on your computer.
- Upload the
wp-adminandwp-includesfolders to your server, overwriting the existing ones. - Do NOT upload
wp-content(that is your content) orwp-config.php(that is your configuration).
This gives you clean core files without affecting your content, themes, plugins, or settings.
Step 6: Check File Permissions
Incorrect file permissions can trigger 500 errors. WordPress requires specific permissions to function properly:
- Directories: 755 (
rwxr-xr-x) - Files: 644 (
rw-r--r--) - wp-config.php: 600 or 640 for extra security
You can check and fix permissions via FTP. In FileZilla, right-click a file or folder and select "File permissions." Set directories to 755 and files to 644. If you have SSH access, you can fix all permissions at once:
find /path/to/wordpress/ -type d -exec chmod 755 {} \;
find /path/to/wordpress/ -type f -exec chmod 644 {} \;
Step 7: Check Server Error Logs
If you have tried everything and the 500 error persists, the server error log is your best friend. Unlike the generic error page, the log contains the specific PHP error that caused the problem.
- cPanel: Go to Errors or Error Log in the Metrics section.
- Plesk: Go to Websites & Domains → Logs.
- SSH: Check
/var/log/apache2/error.logor/var/log/nginx/error.log.
The log will show you the exact file, line number, and error message. This information makes fixing the problem much easier.
You can also enable WordPress debug logging by adding these lines to wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
After enabling this, reproduce the error and then check /wp-content/debug.log for the specific error message.
When to Contact Your Host
If none of the above fixes work, the issue might be on the server side — something you cannot fix yourself. Contact your hosting provider and tell them:
- You are seeing a 500 Internal Server Error.
- You have already tried fixing .htaccess, increasing memory, disabling plugins, and switching themes.
- Ask them to check the server error logs for the specific PHP error.
Good hosting providers will investigate and fix server-side issues. If your host is unhelpful or this happens frequently, it might be time to migrate to a better host.
Preventing 500 Errors
- Keep WordPress, themes, and plugins updated — Outdated software is the #1 cause of conflicts.
- Use a staging environment — Test updates before pushing to production.
- Do not edit .htaccess manually unless you know what you are doing.
- Set up monitoring — Use a free uptime tool to get alerted when your site goes down.
- Maintain regular backups — So you can restore quickly. See my backup guide.
The 500 error is generic, but the fix almost never is. Work through these steps in order and you will find the cause. For more troubleshooting guides, check my complete list of common WordPress errors.
Written by Marvin
Our team tests and reviews WordPress products to help beginners make confident choices.
Learn more about our team →You might also like
How to Fix the WordPress White Screen of Death (Step by Step)
Your WordPress site shows a blank white page — no error, no clue. I walk through every method I use to fix the White Screen of Death, from enabling debug mode to disabling plugins via FTP.
postCommon WordPress Errors and How to Fix Them (Complete Guide)
WordPress errors are frustrating but rarely fatal. I cover the 11 most common WordPress errors with quick-fix solutions for each one — based on years of troubleshooting real sites.
postHow to Fix the "Too Many Redirects" Error in WordPress
Stuck in a redirect loop? I explain what causes ERR_TOO_MANY_REDIRECTS in WordPress and walk through 6 fixes — from clearing cookies to fixing SSL conflicts and .htaccess rules.
postHow to Fix the WordPress Memory Exhausted Error
Seeing "Fatal error: Allowed memory size of X bytes exhausted"? I explain why this happens and show you 4 ways to increase the WordPress memory limit — with exact code snippets for each method.