Skip to content

WordPress 500 Internal Server Error: what it means and how to fix it

· The AYT team · 5 min read

Man typing on a laptop at a wooden table, with a phone and notebook beside it

A 500 Internal Server Error means the server ran into a problem while generating the page and can't say more precisely what. It isn't a problem with the visitor, their browser or their internet connection. On a WordPress site the cause is most often a fatal PHP error from a plugin, the theme, running out of memory or an incompatible PHP version. The first step is to read the error log, which names the exact file and line.

If you're only a visitor

There's nothing you can fix on your side. Reload the page after a few minutes; if the error stays, let the site owner know. The rest of this article is for whoever runs the site.

Step 1: read the error log

The error log is where PHP writes what happened. You'll find it in your hosting panel (usually a page called "Errors" or "Error log") or as an error_log / php-error.log file in the site's folder or in a logs folder.

A typical line looks like this:

PHP Fatal error: Uncaught Error: Call to undefined function create_function() in /home/account/public_html/wp-content/plugins/old-plugin/plugin.php:42

The path in the message names the culprit: here, the old-plugin plugin. If it's in wp-content/themes/, it's the theme.

The panel's Errors page with a site's error log

If you have no access to the server's log, turn on WordPress's own log. In wp-config.php, above the line /* That's all, stop editing! */:

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

Reload the page with the error and read wp-content/debug.log. When you're done, set WP_DEBUG back to false and delete debug.log: it can be opened from a browser and may reveal paths and details about the site.

Step 2: check the admin email

Since version 5.2, WordPress catches many fatal errors and shows "There has been a critical error on this website" instead of a blank page. At the same time it emails the admin address with the subject "Your Site is Experiencing a Technical Issue", naming the plugin or theme that failed and including a recovery mode link. The link lets you into wp-admin with the faulty plugin paused, so you can deactivate or update it. Check your spam folder too.

Step 3: deactivate the plugins

If the log isn't clear or you can't reach it, switch off every plugin at once: in the File Manager or over FTP, rename the wp-content/plugins folder to plugins-off. If the site comes back, rename it to plugins again and reactivate the plugins in wp-admin one at a time, checking the site after each. The one that brings the error back is the culprit.

To switch off a single plugin, rename its folder (for example wp-content/plugins/plugin-name to plugin-name-off).

Step 4: switch the theme

If the plugins aren't to blame, rename the active theme's folder in wp-content/themes/. WordPress falls back to a default theme from the Twenty series (for example Twenty Twenty-Five), if one is installed. If the site comes back, the problem is in the theme, usually in functions.php after a manual edit.

Step 5: PHP memory

The log says Allowed memory size of ... bytes exhausted. A script went over memory_limit. The steps are in the guide to increasing the WordPress memory limit.

Step 6: the PHP version

Did the error appear right after you or your host changed the PHP version? Old plugins and themes sometimes use functions removed in PHP 8, such as create_function() or each(), and fail with a fatal error. Update the plugin or theme; if there's no new version, switch back to the previous PHP version for now and look for a replacement. There's more on choosing a PHP version in the guide to changing the PHP version in WordPress.

Step 7: .htaccess and permissions (on Apache)

On Apache servers, a wrong rule in .htaccess (added by a plugin or by hand) causes a 500 across the whole site. Rename the file to .htaccess-old, check the site, then go to Settings → Permalinks and click Save, so WordPress writes a clean .htaccess. nginx doesn't read this file, so there it can't be the cause.

On some Apache servers, permissions that are too open (777) on files or folders also lead to a 500. The usual values are 644 for files and 755 for folders.

500 versus 502, 503 and 504

The neighbouring codes have other causes: 502 and 504 mean the web server didn't get an answer from PHP in time, and 503 means the service is temporarily unavailable (overloaded or under maintenance). The differences are explained in the guide to HTTP errors 403, 404, 500, 502, 503 and 504.

Frequently asked questions

Does a 500 error hurt my Google rankings?

A few minutes of it, no. If it lasts for days, Google slows down crawling the site, and pages that keep returning 5xx for a long time can drop out of the index. Fix it quickly and check the indexing report in Search Console afterwards.

I restored a backup and the error is still there. Why?

Either the backup is from a time when the problem already existed, or the cause isn't in the site's files (the PHP version, the memory limit, a server setting). The error log tells you which.

On AYT hosting

In the AYT panel, the Errors page shows each site's error log, without hunting for files. From the WordPress Toolkit you can activate or deactivate plugins and themes and turn on debug mode. You choose the PHP version for each site, and if you want to go back to an earlier state, you restore from the daily, weekly or monthly backups. Monitoring checks the site and emails you an alert when it stops responding. The plan details are on the WordPress hosting page.

More articles

All articles