Skip to main content

How to Fix the 500 Internal Server Error in WordPress

  • By Md Sayfur Rahman
  • 6 min read
How to Fix the 500 Internal Server Error in WordPress

A 500 Internal Server Error is one of the least helpful messages a website can show. It only tells you that something went wrong on the server, not what or where. But the server almost always records the real cause in a log file, and once you find that line, the fix is usually quick.

This guide explains what the 500 error means, how it differs from similar errors, the most common causes on WordPress sites, and how to find and fix the cause step by step.

What the 500 Error Means and How It Differs From Similar Errors

When you open a page, your browser asks the server for it, and the server answers with a status code. A code in the 500 range means the problem is on the server side, not on the visitor's computer. Each code points to a slightly different part of the problem, which helps you know where to look first.

ErrorWhat it usually means on a WordPress siteWhere to look first
500 Internal Server ErrorPHP or the web server hit a problem it could not handlePHP error log, .htaccess file, recent plugin updates
"There has been a critical error on this website"WordPress caught a fatal PHP error and showed its own messageRecovery mode email, debug.log
502 Bad GatewayThe web server did not get a valid answer from PHPHosting status, PHP processes, ask your host
503 Service UnavailableThe server is overloaded, under maintenance or blocking trafficHosting status, traffic spikes, maintenance mode that did not turn off
504 Gateway TimeoutPHP took too long to answerSlow plugins, large imports, slow database queries
508 Resource Limit ReachedYour shared hosting account used all of its allowed resourcesHosting resource usage, bots, heavy plugins

This difference matters. The critical error message usually means a broken plugin or theme, and our guide on how to fix the WordPress critical error covers it in detail. A plain 500 error can also come from the server setup itself, such as the .htaccess file or file permissions, so the search for the cause is a little wider.

The Most Common Causes on WordPress Sites

Developers who fix 500 errors every day see the same causes many times. A fatal error in a plugin is the most common one, especially right after an update. The other common causes are listed below.

  • A plugin or theme error. A new update has a bug, does not work with your PHP version, or was only partly installed.
  • PHP memory limit reached. A large plugin, an import or a page builder needs more memory than the server allows.
  • A broken .htaccess file. A plugin, a security tool or malware added a rule that the server cannot read.
  • Wrong file permissions. After a migration or a manual upload, the server is not allowed to read some files.
  • Hosting resource limits. On shared hosting, too many visitors, bots or heavy plugins can use up the account's limits.
  • An old PHP version. WordPress.org statistics show that about 37.6% of WordPress sites still run a PHP version that no longer gets security fixes. When a plugin update needs newer PHP, these sites are more likely to break.

How to Fix the 500 Error Step by Step

Work through these steps in order and stop when the site works again. Take a backup first if your host offers one, so you can undo any change. You only need access to your hosting control panel and its file manager.

  1. Read the error log. In your hosting panel, open the PHP error log or the error log for your domain. Look at the lines from the time the error started. A line that mentions a file in wp-content/plugins or wp-content/themes points directly to the cause.
  2. Turn on the WordPress debug log if there is no server log. Add the debug lines shown below to wp-config.php, load the page once, and then open wp-content/debug.log.
  3. Test the .htaccess file. In the file manager, rename .htaccess to .htaccess-old and reload the site. If it works, go to Settings and then Permalinks in WordPress and click Save to create a clean new file.
  4. Turn off the plugin that caused the error. Rename its folder in wp-content/plugins. If you do not know which plugin it is, rename the whole plugins folder, log in, then rename it back and turn plugins on one by one.
  5. Raise the memory limit if the log mentions memory. Ask your host to raise it, or set WP_MEMORY_LIMIT to 256M in wp-config.php.
  6. Check file permissions after a migration. Folders should usually be 755 and files 644. Your host can fix ownership problems quickly if needed.
  7. Ask your host to check the server. If none of the steps above helps, the problem may be with PHP itself or with resource limits. Send your host the exact time of the error, so they can find it in the server logs.

For step 2, add these lines to wp-config.php, just above the line that says "That's all, stop editing". The last line keeps the error details hidden from visitors.

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

Remember to set WP_DEBUG back to false when the site works again.

Site showing a 500 error right now? Our team finds the cause in the server logs and fixes it fast. Request emergency help and we will start working on it immediately.

A Real Example From the Support Forums

In one WordPress.org support thread, a store owner updated WooCommerce and then saw "HTTP ERROR 500" on the cart and order pages, while product pages still loaded. Turning off other plugins did not help. The error log showed messages about missing WooCommerce files and functions that could not be found.

Messages like these usually mean the update did not install completely, so some plugin files were missing. In this kind of case, the fix is to reinstall the plugin cleanly from a fresh download, not to change server settings. The log also showed errors from other plugins and from the theme, which is common on sites where many updates have been delayed and then installed at once.

The lesson is simple. Always read the log before you change anything. It often points to a different cause than the one you expected, and it saves you from making changes that do not help.

How to Prevent 500 Errors

Most 500 errors appear right after an update or a server change, so a careful update routine prevents most of them. Update plugins regularly in small groups, check your key pages afterwards, and keep your PHP version current. Our guide on how to update WordPress safely explains this routine.

Keep a recent backup that you can restore in minutes, as described in our WordPress backup strategy guide. If the error came from a strange rule in .htaccess or from files you do not recognise, your site may have been hacked, so follow our guide on how to clean a hacked WordPress site. For ongoing protection, our WordPress maintenance plans include tested updates, daily backups and monitoring.

Written by

Md Sayfur Rahman

A website that doesn't break, doesn't slow down, and doesn't get hacked. Sounds like a fantasy. But it's exactly what I build. After more than 14 years in the WordPress ecosystem, I've learned that a truly great website isn't just about how it looks on launch day. It's about how it performs under pressure, how easy it is to manage, and how secure it remains as time goes on.