A 500 error, or Internal Server Error by its full name, means the server received the request and could not return a page. The problem is on the site or server side, not with the visitor, so refreshing or clearing the browser cache usually won’t help. You may also run into a 503 Service Unavailable message, which usually points to a server that is overloaded or under maintenance rather than broken code, so the check there is different.
On WordPress sites the causes are well known, and there is a sensible order to check them in: a corrupted .htaccess file, a plugin or theme that broke, a PHP memory limit, damaged core files, and finally a problem on the server itself. For each one I’ll explain how to tell if it’s your case and how to fix it.
Before any change, make a full backup of your files and database. The official WordPress documentation asks you to make sure you have a backup or a test environment before you touch the site, and every step here involves changing files.
What a 500 error code means and why to fix it fast
This code is a generic message from the server. It doesn’t say what broke, only that something on the server side failed. That is why the first step is always to find a log that spells out the cause.
From Google’s point of view, this is a server error. According to the Google Search Central documentation, 5xx errors make the crawler slow down its crawl rate for the site, in proportion to the number of URLs returning errors. Pages that are already indexed are kept at first, but if the error continues they are eventually dropped. In Search Console, such pages appear in the page indexing report with the reason Server error (5xx). If you want the wider picture, I covered it in the guide on why my website doesn’t show up on Google.
There is another message worth knowing: “There has been a critical error on this website”, which links to a WordPress critical error guide of its own. It’s what WordPress displays when it catches a fatal PHP error, and it is returned with a 500 code. If that’s what you see, check the site administrator’s email. WordPress sends a link there to Recovery Mode, which lets you into the dashboard with the problem plugin or theme paused.
Step 1: Turn on the WordPress log
When you have a log, there is no need to guess. It shows which file and which line caused the failure.
To turn it on, open your site files through FTP or your host’s file manager, open wp-config.php, and add these lines before the line /* That's all, stop editing! Happy blogging. */:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
If a WP_DEBUG line already exists, change it instead of adding a duplicate. Then reload the page and open wp-content/debug.log. If there’s a line with Fatal error, the path in it points to the culprit. A folder inside wp-content/plugins is a plugin, and a folder inside wp-content/themes is a theme.
The WordPress documentation doesn’t recommend leaving WP_DEBUG on for a live site, and Site Health warns that the log file may be accessible to anyone. So when you finish, set the value back to false and delete the file. And if the log is empty, the error probably happens before WordPress loads, and the next file to check is .htaccess.
Step 2: A corrupted .htaccess file
On Apache servers, WordPress uses the .htaccess file to decide how the server serves pages. One wrong line in the file can return a 500 error for the whole site, and the official WordPress documentation lists a corrupted .htaccess file as the most likely cause.
Here is how to check and fix it:
- In FTP, go to the site’s root folder and rename the
.htaccessfile to.htaccess_old. Files that start with a dot are hidden in many FTP programs, and you may need to turn on showing hidden files. - Load the site. If it came back, the file was the problem.
- Go to the dashboard, to Settings > Permalinks, and click Save Changes. WordPress will create a new file. If the message “Permalink structure updated.” appears, all is well. If “You should update your .htaccess now.” appears, you need to copy the rules shown at the bottom of the screen into the file by hand.
The basic WordPress block in the file looks like this:
# BEGIN WordPress
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]
# END WordPress
If the old file had extra rules you need, such as redirects, add them back one at a time and test the site after each one.
Step 3: A plugin or theme that broke
Suspicion moves to a plugin or theme when the log points to their folder, or when the problem started right after an update, an install or a code change. There are a few ways to check:
- One plugin: In
wp-content/plugins, rename the folder of the suspect plugin. WordPress won’t find it and will deactivate it. - All plugins: Rename the
pluginsfolder toplugins.hold, go to/wp-admin/plugins.php, and then rename it back toplugins. The plugins will stay off, and their settings are kept. Then turn them on one by one until the error comes back. - The theme: Temporarily switch to a default WordPress theme. If the problem is in code added by hand to
functions.php, fix or remove that line.
And if you end up deciding to replace the theme permanently and not just test it, there is a structured process for converting a WordPress theme on a live site without breaking pages, menus and SEO.
If you work with phpMyAdmin, you can also deactivate all plugins from the database: in the wp_options table, in the active_plugins row, change the value to a:0:{}. If you don’t know the tool, stay with the folder method.
Step 4: The memory limit and the PHP version
The sign here is a memory exhausted error in the log, or a failure that started after changing the PHP version in the hosting panel.
You can raise the memory limit in wp-config.php, before the “That’s all, stop editing!” line. The value in the example comes from the WordPress documentation:
define( 'WP_MEMORY_LIMIT', '96M' );
Some hosting companies don’t allow raising memory from inside WordPress, and then you need to contact them. The documentation also notes that raising memory can hide a different problem, so it’s worth checking what is consuming it. If the error started after moving to a newer PHP version, you can see the current version in Tools > Site Health > Info, in the Server section. According to the WordPress requirements page, the recommended version is PHP 8.3 or higher, but an old plugin or theme may not work with it. In that case, find and update them as in step 3.
Step 5: Corrupted core files, the server and Cloudflare
If a WordPress update was cut off midway, the core files may be left partial. The official documentation suggests re-uploading the wp-admin and wp-includes folders from a fresh WordPress download. In the wp-content folder, where the plugins, themes and media live, don’t touch anything at this stage.
If the WordPress log is empty, the next step is the server’s Error Log, which is in your hosting panel. It records errors even when WordPress didn’t get to write anything, and your host’s support can pull the relevant lines for you.
And if the site goes through Cloudflare, according to their documentation a 500 error usually points to a problem on the origin server. So start with the steps above and with your host, and contact Cloudflare support only if the body of the error message shows cloudflare or cloudflare-nginx. Cloudflare also notes that the cause doesn’t always show up in the origin server’s log, so it’s worth checking the logs of middle layers such as a firewall or cache.
When to stop and call an expert
There are situations where it’s better to stop before you continue alone:
- You have no recent backup, and you’re not sure you could restore the site.
- You went through all the steps and the site still returns 500.
- The log points to custom code or to a theme built specifically for you.
- The plugin that broke is a core component, such as the store or the booking system, and you can’t simply turn it off.
- You don’t feel comfortable editing files over FTP or the database.
In cases like these, another attempt can make the problem worse. If you tried and couldn’t bring the site back, talk to me and I’ll handle it.
Frequently asked questions
What is a 500 error?
It’s a server response saying it received the request and could not complete it because of a failure on its side. The full name is Internal Server Error. The code itself doesn’t explain what broke, so you need to check the log.
Does a 500 error hurt my Google rankings?
According to Google’s documentation, 5xx errors make the crawler slow down crawling. Pages that are already indexed are kept at first, but if the error continues they are eventually dropped. That is why it’s worth fixing quickly.
Visitors see the error and I don’t. Why?
You may be seeing a copy saved in your browser or a cache. Check in a private browsing window, and check in Search Console whether pages appear with the reason Server error (5xx).
I renamed .htaccess and the site came back, but the links don’t work. What do I do?
Go to Settings > Permalinks and click Save Changes. WordPress will create a new file with the right rules. If the file isn’t writable, it will show the rules at the bottom of the screen and you’ll need to copy them by hand.
Does this problem delete my site’s content?
The error stops the page from being displayed. Your posts, pages and settings live in the database and the files, and the diagnostic steps here don’t touch them. The backup you make before every change makes sure you have somewhere to go back to even if something goes wrong during the fix.
What’s the difference between a 500 error and a 403 error?
A 500 means the server failed to handle the request. A 403 means the server understood the request but refuses to give access to the resource. The fix is different too: with a 500 you look for broken code, and with a 403 you look for permission rules or a block, as detailed in the guide to the WordPress 403 error.
