ZeroToWP
errorsby Marvin

How to Fix the 500 Internal Server Error in WordPress

Share this article

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.

WordPress advanced debugging documentation page

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:

  1. Corrupted .htaccess file — By far the most common cause. Bad rewrite rules or conflicting directives in .htaccess crash Apache.
  2. PHP memory limit exceeded — A script uses more memory than allowed, and PHP dies with a 500 error instead of a proper message.
  3. Plugin or theme conflict — A buggy plugin or theme causes a PHP fatal error that the server cannot recover from.
  4. 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.

  1. Connect to your site via FTP (I use FileZilla) or your hosting file manager.
  2. In your WordPress root directory, find the .htaccess file. Note: it is a hidden file, so make sure your FTP client shows hidden files (in FileZilla: Server → Force showing hidden files).
  3. Rename .htaccess to .htaccess_backup.
  4. Create a new .htaccess file 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:

  1. Navigate to /wp-content/.
  2. Rename the plugins folder to plugins-disabled.
  3. 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:

  1. Navigate to /wp-content/themes/.
  2. Rename your active theme folder (e.g., my-theme to my-theme-disabled).
  3. 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.

  1. Download a fresh copy of WordPress from wordpress.org.
  2. Extract the ZIP on your computer.
  3. Upload the wp-admin and wp-includes folders to your server, overwriting the existing ones.
  4. Do NOT upload wp-content (that is your content) or wp-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.log or /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.

Frequently Asked Questions

What exactly causes a 500 Internal Server Error in WordPress?

A 500 error means the web server encountered a condition it could not handle, but it does not tell you what that condition is. In WordPress, the four most common causes are a corrupted .htaccess file with bad rewrite rules, a PHP fatal error triggered by a plugin or theme, exceeding the PHP memory limit, and incorrect file permissions. The error is server-side, which means the problem is on your hosting server, not in the visitor's browser.

Can a 500 error damage my WordPress site or database?

No, a 500 error does not cause data loss or corruption by itself. It simply means the server cannot process the request. Your database, posts, pages, and media files are all still intact. The only risk is if the 500 error was caused by a failed core update that left files in a half-updated state — but even then, re-uploading fresh WordPress core files fixes it without data loss.

How do I check the error log to find the actual cause?

In cPanel, go to the Metrics section and click "Errors" or "Error Log" to see recent PHP errors. You can also enable WordPress debug logging by adding define('WP_DEBUG', true) and define('WP_DEBUG_LOG', true) to wp-config.php, then reproduce the error and check the file at wp-content/debug.log. The log will show the exact file, line number, and error message that caused the 500 error.

Why does the 500 error only appear on certain pages?

When the 500 error appears only on specific pages, it is usually caused by a plugin that runs on those pages (like a contact form plugin on your contact page, or WooCommerce on product pages). It can also happen when a specific post or page has content that triggers a PHP error — for example, a shortcode from a deactivated plugin. Enable WP_DEBUG to see which file and line number is causing the error on those specific pages.

Will a 500 Internal Server Error hurt my SEO?

If the error is temporary (under a few hours), the impact is minimal — Google will simply retry later. But if your site returns 500 errors for days, Google will stop crawling affected pages and may eventually drop them from search results. Use a free uptime monitoring tool to get alerted immediately when your site goes down, so you can fix it before it affects your rankings.

How do I fix a 500 error if I cannot access the WordPress admin at all?

When you are completely locked out, connect to your site via FTP or your hosting file manager. Start by renaming .htaccess to .htaccess_backup (this fixes it about half the time). If that does not work, rename the plugins folder to plugins-disabled to deactivate all plugins. You can also rename your active theme folder to force WordPress to use a default theme. Work through these steps one at a time, testing after each change.

Marvin

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

Leave A Reply

Thanks for choosing to leave a comment. All comments are moderated, and your email address will NOT be published. Please do NOT use keywords in the name field.