How to Fix the 500 Internal Server Error in WordPress

Overview

The 500 Internal Server Error is a generic HTTP status code that means something went wrong on the server, but the server couldn’t tell you what. In WordPress, this usually comes down to a handful of specific causes: a corrupted .htaccess file, a PHP memory limit that’s too low, a broken plugin or theme, or a misconfigured file permission. The trick is narrowing it down quickly.

This error shows up in a lot of scenarios — after a WordPress update, after installing a new plugin, or sometimes completely out of nowhere after a server configuration change. If your site just went blank or is showing “500 Internal Server Error” to all visitors, this article is where you start.

One thing beginners often miss: WordPress itself may be fine, but the server is failing before WordPress even loads. That’s why you can’t always rely on the WordPress admin panel to diagnose it — you’ll need file-level access too.

Prerequisites

  • Access to your hosting control panel (cPanel, Plesk, or WHM)
  • FTP/SFTP access or access to your host’s File Manager
  • SSH access (optional, but helpful for faster diagnosis)
  • Your WordPress admin credentials (if the dashboard is still accessible)
  • A recent site backup — always pull one before making changes

Step-by-Step Instructions

Step 1: Check Your Error Logs

Before changing anything, look at the actual error. The server log will usually tell you exactly which file triggered the 500 error.

In cPanel, go to Metrics > Errors to see the last 300 lines of your error log. Alternatively, your error log is typically located at:

/home/yourusername/public_html/error_log

You can also check via SSH:

tail -50 /home/yourusername/public_html/error_log

Look for lines timestamped around when the error started. You’ll usually see something like PHP Fatal error, out of memory, or a specific plugin file path. That’s your starting point.

📝 Note: If the error log is empty or doesn’t exist, WordPress error logging may be disabled. Jump to Step 3 to enable it before continuing.

Step 2: Rename Your .htaccess File

A corrupted .htaccess file is the single most common cause of a 500 error in WordPress. Renaming it forces WordPress to regenerate it cleanly.

In cPanel File Manager, navigate to /public_html/ and rename .htaccess to .htaccess_old. Then reload your site.

If the site loads, your .htaccess was the problem. Generate a fresh one by going to WordPress Admin > Settings > Permalinks and clicking Save Changes without changing anything. WordPress will write a new .htaccess automatically.

⚠ Warning: Don’t skip making a copy first. Renaming (not deleting) lets you restore the original if needed.

📝 Note: If the File Manager doesn’t show .htaccess, enable hidden files. In cPanel File Manager, click Settings in the top right and check Show Hidden Files (dotfiles).

Step 3: Enable WordPress Debug Mode

If the error log doesn’t give you enough detail, turn on WordPress debug logging. This captures errors that WordPress catches internally but doesn’t display to visitors.

Open /public_html/wp-config.php and find the line that reads define('WP_DEBUG', false);. Replace that block with:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

Setting WP_DEBUG_DISPLAY to false is important — it writes errors to a log file instead of displaying them to site visitors. The log will appear at /public_html/wp-content/debug.log.

⚠ Warning: Remember to revert these debug settings once you’ve fixed the issue. Leaving WP_DEBUG enabled on a live site can expose sensitive path information.

Step 4: Deactivate All Plugins

If the .htaccess fix didn’t work, plugins are the next likely cause. A plugin with a PHP error can crash the entire WordPress load process.

If you can access the admin dashboard, go to Plugins > Installed Plugins, select all, and choose Deactivate from the bulk actions menu.

If the dashboard is inaccessible, rename the entire plugins folder via FTP or File Manager. Navigate to /public_html/wp-content/ and rename plugins to plugins_disabled. WordPress will disable all plugins automatically when the folder name doesn’t match.

If the site loads after this, rename the folder back to plugins and reactivate plugins one at a time until the error returns. The last one you activated is your culprit.

Step 5: Increase the PHP Memory Limit

WordPress needs a minimum of 64MB of PHP memory, but many operations (WooCommerce, page builders, image processing) need 256MB or more. A memory exhaustion error almost always produces a 500.

Add this line to your wp-config.php, just above the /* That's all, stop editing! */ line:

define('WP_MEMORY_LIMIT', '256M');

If that doesn’t apply the change (some hosts override it at the server level), try adding this to your .htaccess:

php_value memory_limit 256M

Or via php.ini if your host supports a custom one in the site root:

memory_limit = 256M

📝 Note: On our Managed WordPress Hosting plans, PHP memory limits are pre-configured for WordPress workloads and can be adjusted through the control panel without editing config files.

Step 6: Check File and Folder Permissions

Incorrect permissions on WordPress files or folders will cause the server to reject requests outright. The standard permissions for WordPress are:

  • Folders: 755
  • Files: 644
  • wp-config.php: 600 or 640

To fix permissions recursively via SSH:

find /home/yourusername/public_html -type d -exec chmod 755 {} ;
find /home/yourusername/public_html -type f -exec chmod 644 {} ;
chmod 600 /home/yourusername/public_html/wp-config.php

⚠ Warning: Don’t set folder permissions to 777. It’s a serious security risk and some servers will actually block requests to directories with world-writable permissions.

Step 7: Switch to a Default Theme

If plugins aren’t the issue, the active theme might be. A PHP error in a theme file will produce a 500 just as easily as a broken plugin.

Via FTP, navigate to /public_html/wp-content/themes/ and rename your active theme folder (e.g., my-theme to my-theme-disabled). WordPress will fall back to its default theme (Twenty Twenty-Four or whichever default theme is installed). If the site loads, the theme was the problem.

Common Issues & Troubleshooting

500 Error Only on the WordPress Admin (/wp-admin)

This usually points to a plugin conflict that only affects the admin area, or a corrupted admin-specific .htaccess rule. Start by deactivating plugins as described in Step 4. If the error is only in wp-admin after a WordPress core update, try re-uploading fresh copies of the /wp-admin/ and /wp-includes/ folders from the official WordPress zip — your database and wp-content folder stay untouched.

500 Error After Updating WordPress Core or PHP Version

Upgrading PHP (say, from 7.4 to 8.1 or 8.2) can break plugins or themes that use deprecated functions. The error log will show something like PHP Deprecated or PHP Fatal error: Call to undefined function. Either temporarily roll back the PHP version in cPanel under Software > Select PHP Version, or update the offending plugin/theme to a compatible version.

Intermittent 500 Errors Under Load

If the error only appears occasionally or under traffic spikes, you’re likely hitting PHP-FPM worker limits or MySQL connection limits on a shared or lower-tier VPS plan. In my experience, this one gets misdiagnosed as a plugin problem constantly. Check your server resource usage in WHM under Server Status > Apache Status or look for Resource temporarily unavailable in the error log. Scaling to a plan with more resources, or enabling object caching with Redis, is usually the right fix here.

500 Error With “Premature End of Script Headers”

This specific message in your error log means a CGI or PHP script crashed before it could output valid HTTP headers. It’s commonly caused by a script timeout or a binary file (like a poorly compiled PHP module) that doesn’t execute cleanly. Check your PHP error log for what was running at the time, and verify your PHP handler is set correctly in cPanel under Software > MultiPHP Manager.

500 Error After Migrating the Site

After a site migration, this is almost always a database connection error masquerading as a 500. Open wp-config.php and confirm that DB_HOST, DB_NAME, DB_USER, and DB_PASSWORD all match the new server’s database credentials exactly. On many cPanel servers, DB_HOST should be localhost, but some managed environments use a socket path or remote hostname instead.

FAQ

Frequently Asked Questions

Why does my WordPress site show a 500 Internal Server Error with no other message?

The 500 error is intentionally vague — the server encountered a problem but won’t expose the details publicly, which is actually a security feature. To find out what actually went wrong, you need to check your server error log or enable WordPress debug logging via wp-config.php. Once you have the real error message, fixing it is usually straightforward.

Can a WordPress plugin really cause a 500 Internal Server Error?

Yes, and it’s one of the most common causes. If a plugin contains a PHP fatal error or tries to use more memory than the server allows, PHP crashes before WordPress can finish loading — resulting in a 500. Deactivating all plugins and reactivating them one at a time is the fastest way to identify which one is responsible.

How do I fix a 500 error if I can't access the WordPress dashboard?

Use FTP, SFTP, or your hosting control panel’s File Manager to make changes directly at the file level. You can rename the plugins folder to disable all plugins, rename .htaccess to force WordPress to regenerate it, and edit wp-config.php to enable debug logging — all without needing the admin dashboard.

Does a 500 Internal Server Error affect my site's SEO?

It can, if it lasts more than a few hours. Search engine crawlers that repeatedly hit a 500 response may eventually drop those pages from the index. A brief, quickly-resolved 500 error typically won’t cause lasting damage, but you should fix it as fast as possible and verify Google Search Console for any crawl errors after the fact.

Why does the 500 error keep coming back after I fix it?

A recurring 500 error usually means the root cause wasn’t fully addressed. Common repeat offenders are a plugin that re-corrupts .htaccess on every page load, a PHP memory limit that’s too low for your site’s actual needs, or a server-level resource limit being hit intermittently under traffic. Check the error log each time it returns — the timestamp and file reference will point you to the pattern.

SHARE THIS ARTICLE

Need help with your hosting?

Host & Tech provides 24/7 support for all VPS, dedicated, and shared hosting customers.

Scroll to Top