What a 500 internal server error actually is
You open your WordPress site and instead of a page you get a short, unhelpful message: "500 Internal Server Error", sometimes with "The server encountered an internal error or misconfiguration and was unable to complete your request" underneath. The admin area may show the same message, or it may load fine while the front of the site fails. Either way, the site is down, and the error message tells you almost nothing about why.
A 500 error is a generic HTTP status code. It means the web server ran into an unexpected condition that stopped it from completing the request, but it cannot or will not say what that condition was. The vagueness is part of the design: the server is reporting that something failed on its side, not on the visitor's computer, and the details stay in the server's own logs. Your browser, connection and computer are almost never the cause.
On WordPress the usual causes are a damaged .htaccess file, a PHP fatal error from a plugin or a theme, an exhausted PHP memory limit, an unsupported PHP version, damaged core files, or wrong file permissions. WordPress's own errors documentation names a corrupt .htaccess file as the most common cause, with plugins, themes, memory and core files behind it. The fixes in this guide work through those causes in that order, starting with the ones that take two minutes.
A 500 error almost never means your content is gone. Posts, pages, images and settings live in the database and the uploads folder, and a server error does not touch them. The problem is in the code that builds the page, not in the content itself. Most 500 errors are fixed by regenerating one file, raising one limit, or disabling one plugin, and this guide works through the fixes in that order.
Note when the error started: right after an update points at that update, after an edit points at that edit, after a server change points at the host, and with no change at all points at something the site has outgrown, such as a memory limit or a PHP version.
500, 502, 503, 504: which error you actually have
Before fixing anything, make sure the error is a 500 and not one of its neighbours, because each one points somewhere different. The number is in the message itself, so check it before you start.
A 500 Internal Server Error means the server itself failed while processing the request. A 502 Bad Gateway means a gateway server got an invalid response from the server behind it. A 503 Service Unavailable means the server is temporarily unable to handle the request, usually because it is overloaded or down for maintenance. A 504 Gateway Timeout means the server waited too long for another server to respond. The fixes here are for the 500; a 502, 503 or 504 on its own usually clears when the upstream service recovers, and a persistent 503 is a question for the host.
Two other WordPress failures are easy to confuse with a 500. A completely blank page with no error message at all is the white screen of death, which is a PHP fatal error with the error message hidden — our white screen of death guide covers that one, and several of its fixes overlap with the ones here. The message "Error establishing a database connection" is a different failure again: WordPress cannot reach the database at all, and it says so plainly. If you see that message instead of a 500, the database credentials in wp-config.php or the database server itself are where to look.
Also check the scope of the failure, because it narrows the search. If the front of the site shows a 500 but wp-admin loads normally, the fault is probably in the theme or in something that only runs on the front of the site. If wp-admin fails too, the fault is deeper — a plugin, the .htaccess file, the memory limit, or the core files. If only one page fails, the fault is in something only that page uses, such as a shortcode in that post or a template file; if every page fails, the fault loads on every page. Try a second page, such as a single post or yoursite.com/wp-login.php, and note the result.
One quick check first: clear your browser cache and reload, then try the site in a private browser window. A cached error page can keep showing a 500 after the site has recovered, and a private window rules that out in thirty seconds. If the error is still there, it is real, and the fixes below apply.
Before you change anything: back up the site
Every fix in this guide changes files or settings, and every change carries a small risk of making things worse. So the first step, before any troubleshooting, is a backup — even though the site is down. A backup is your undo button: if a fix goes wrong, you restore the backup and you are back where you started instead of further down the hole.
If wp-admin still loads, take the backup from the dashboard: a backup plugin such as UpdraftPlus can create a full backup — database plus files — and send it to remote storage such as Google Drive. If wp-admin is down too, use the host's file manager or control panel for a one-click backup, or download the files and export the database yourself. Our WordPress backup guide walks through both routes, including restoring a backup when the dashboard is unreachable.
At minimum, before editing any file, download a copy of that file first. Editing wp-config.php or .htaccess without a copy of the original is how a five-minute fix turns into a lost afternoon: one wrong character in either file takes the whole site down, and without the original you have nothing to restore. Download first, edit second, every time.
If you cannot back up at all — no dashboard, no file manager access — stop and contact your host before changing anything. A host can usually restore a server-side backup, which is far safer than editing files blind.
Fix 1: Find the real error first
A 500 error is the server refusing to say what went wrong, so the most valuable first step is to make it tell you. Everything after this is guesswork without it, and the error log usually names the exact file and line that failed. There are two places to look: the server's own error log, and WordPress's debug log.
Start with the server error log. Most hosting control panels expose it under Errors, Logs or Metrics — look for "error log" or "raw error log". Open it and look for entries from the time the 500 started: a typical entry names a file path such as wp-content/plugins/some-plugin/file.php and a line number, or reports "Allowed memory size exhausted", or points at .htaccess. Some hosts instead write an error_log file into the site root or the wp-admin folder — if the control panel has no log viewer, check for that file with the file manager.
If the server log is empty or unreachable, turn on WordPress debug logging instead. Open wp-config.php in the host's file manager or over FTP — it sits in the root folder, next to wp-admin, wp-content and wp-includes. Before editing it, download a copy: this file holds the database credentials, and a mistake here takes the site down. Then find the line that reads /* That's all, stop editing! Happy publishing. */ and add these three lines directly above it:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
These three constants do three different jobs. WP_DEBUG switches debugging on. WP_DEBUG_LOG writes every error to a file called debug.log inside the wp-content folder. WP_DEBUG_DISPLAY set to false keeps the errors off the public page, so visitors still see the 500 while you read the real error in private. The official documentation is explicit that these lines must go above the "stop editing" line, and that WP_DEBUG_LOG does nothing unless WP_DEBUG is enabled first. Save the file, then reload the broken page once.
Now open wp-content/debug.log — if the file does not exist yet, reload the broken page once more, since the log is only created when an error happens. Look for the most recent line beginning with "PHP Fatal error": it names the file and line where the failure happened, and the path names the culprit — wp-content/plugins/some-plugin/ points at that plugin, wp-content/themes/ at the theme, wp-includes or wp-admin at the core files. A typical memory error reads "PHP Fatal error: Allowed memory size of 41943040 bytes exhausted", which points at the memory limit fix below.
Read the last fatal error line, not the first: a debug log also collects harmless warnings and notices, and the fatal error that stopped the page is usually the last entry. If the log is long, search for "Fatal error" and read the most recent match.
Two clean-up rules. First, when the site is fixed, turn debugging back off: change WP_DEBUG back to false and remove the WP_DEBUG_LOG and WP_DEBUG_DISPLAY lines. Debug mode is meant for local and staging installs, not live sites — leaving it on slows the site and fills the log indefinitely. Second, delete debug.log: it sits in the public web folder, so on many hosts anyone can read it, and it contains file paths and error details that do not belong in public.
Fix 2: Regenerate a clean .htaccess file
If the error log says nothing, or points at the configuration, the .htaccess file is the next place to look — WordPress's own documentation names a corrupt .htaccess file as the most common cause of a 500 error. The .htaccess file is a small configuration file in the site root that controls how the Apache web server handles requests, including the permalink redirects WordPress relies on. A single bad line in it — from a failed plugin save, a bad edit, or a plugin writing rules the server rejects — produces a 500 on every page, because the server reads the file before it runs anything else.
The test takes two minutes. Open the host's file manager or FTP client and go to the root folder of the WordPress installation. Look for .htaccess. Note the dot at the start of the name: files beginning with a dot are hidden in many file managers, so you may need to turn on "show hidden files" before it appears. Download a copy first, then rename the file to .htaccess_old — do not delete it yet. Reload the site.
If the site loads, the .htaccess file was the problem. Now regenerate a clean one: log in to wp-admin, go to Settings, then Permalinks, and click Save Changes without changing anything. WordPress writes a fresh .htaccess file with its default rules. Reload the site and check the main pages, including a single post and a category page, to confirm the permalinks still work.
If the site still shows a 500 with the file renamed, the .htaccess file was not the cause — rename .htaccess_old back to .htaccess and move on to the next fix. The default WordPress rules a fresh file contains look like this, for comparison against a file you suspect has been tampered with:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
One exception: servers running nginx do not use .htaccess at all, so if your host runs nginx, skip this fix entirely — there is no .htaccess file to repair, and creating one changes nothing. The host's documentation or support can confirm which web server the account runs on.
Fix 3: Raise the PHP memory limit
If the error log says "Allowed memory size exhausted", or if the 500 appears on media-heavy pages, during imports, or when saving large posts, the cause is memory, not a faulty plugin or theme. Every PHP request gets a fixed amount of memory, and when WordPress asks for more than the limit allows, PHP stops the request — which the visitor sees as a 500 error.
WordPress sets its own memory request through two constants: WP_MEMORY_LIMIT for normal front-end requests, defaulting to 40M on a single site and 64M on multisite, and WP_MAX_MEMORY_LIMIT for admin screens, defaulting to 256M. These are requests, not guarantees — the PHP memory_limit setting on the server is the real ceiling, and if the server allows only 128M, asking WordPress for 256M changes nothing.
To raise the limit, open wp-config.php — again, above the "That's all, stop editing!" line — and add:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
Save the file and reload the broken page. If the 500 clears, memory was the cause. Do not set these values absurdly high — 1024M on a small site does not make it faster, it just lets a runaway script consume more memory before failing — and if the new value has no effect at all, the host has locked the PHP memory setting, and only the host can raise it.
To confirm what the site is actually running, check Tools, then Site Health, then Info, and open the Server section: it shows the PHP memory limit WordPress resolved, alongside the PHP version. If the number does not change after your edit, the server is enforcing its own ceiling — some hosts let you raise it from a PHP settings section in the control panel, and if neither route works, ask support to raise it.
Memory exhaustion is also a symptom worth reading: a site that ran fine for a year and suddenly exhausts its memory has usually gained something hungry — a new plugin, a badly coded feature, or a traffic spike. Raising the limit fixes the 500 today; finding the hungry plugin stops it coming back. Our WordPress speed optimisation guide covers keeping a site's resource use under control.
Fix 4: Disable the plugins
Plugins cause a large share of 500 errors, so disabling them resolves many cases. If the dashboard works, this takes two minutes: go to Plugins, select all, choose Deactivate from the bulk actions menu, and apply it. Reload the front of the site — if it loads, one of the plugins was the cause, proved without touching a file.
If wp-admin shows a 500 too, disable the plugins from the file system: open the host's file manager or FTP client, go into wp-content, and rename the plugins folder to plugins-old. That single rename deactivates every plugin at once. Reload the site: if it loads, a plugin was the cause. Rename the folder back to plugins, then reactivate the plugins one by one from the dashboard, reloading the front page after each one — when the 500 returns, the plugin you just reactivated is the faulty one. Leave it deactivated.
There is a faster variant when the error log already named a plugin: rename just that one plugin's folder inside wp-content/plugins — some-plugin to some-plugin-off, for example. WordPress treats a plugin whose folder it cannot find as deactivated, so the site should come back immediately while every other plugin keeps working.
Once you have identified the faulty plugin, decide what to do with it. If it broke after an update, the plugin's page on WordPress.org lists earlier versions under its Advanced view, so you can install the previous one. If the plugin is essential, check the author's support forum for a known conflict before reinstalling. And if it is one you barely use, delete it: every plugin is code that can break, and one that earns its keep only occasionally is not worth a 500 error. Our WordPress security guide covers keeping the plugin list short and updated.
After deactivating plugins, clear any cache before judging the result: a caching plugin or the host's server cache may keep serving the 500 page it stored during the failure. Clear the cache from the host control panel, and check the site in a private browser window.
Fix 5: Switch to a default theme
If disabling every plugin does not bring the site back, the theme is the next suspect. The theme controls how every page is rendered, so a broken theme file — usually functions.php, which runs on every page load — produces a 500 across the whole site. Theme faults usually follow a theme update, a bad edit to the theme files, or a theme that has not been updated for the current WordPress or PHP version.
If wp-admin loads, go to Appearance, then Themes, and activate one of WordPress's bundled default themes — the Twenty Twenty series that ships with WordPress. Reload the front of the site: if it loads with the default theme, the active theme is the cause, and the site is back up — plain-looking, but up.
If wp-admin is down, switch themes from the file system. Open the file manager or FTP, go into wp-content/themes, and rename the active theme's folder — for example, rename my-theme to my-theme-off. WordPress cannot load a theme whose folder is missing, so it falls back to a default theme automatically, provided one is installed. Reload the site: if it loads, the theme was the cause.
Two things to know. First, this only works if a default theme is installed — WordPress ships with one, but some hosts or site builders remove it. If renaming produces a missing-theme error, upload a fresh default theme from the WordPress theme directory, or ask the host to. Second, switching themes deletes nothing: content, menus and widgets live in the database, and renaming the folder back restores the theme exactly as it was. But do not rename it back and hope — a theme that produced a 500 will produce it again. Update it, replace it, or have its author look at the error the debug log recorded.
One common special case: a syntax error in the theme's functions.php, often from pasting a code snippet found online. A single missing semicolon or bracket there breaks every page, because the file runs on every load. If the 500 started right after you edited functions.php, restore the copy you downloaded before editing, or remove the snippet you added.
Fix 6: Check file and folder permissions
Wrong file permissions are a quiet cause of 500 errors: the web server cannot read a file it needs, or a script cannot execute, so the request fails. This usually follows a migration, a restore from backup, or a manual upload that set the permissions wrong. It is easy to check and easy to fix, but it is also easy to make worse, so change only what is wrong.
The standard WordPress permissions are folders set to 755 and files set to 644. In the host's file manager or FTP client, select the folders and files in the site root and check their permission numbers — most file managers show them in a column, or under a right-click Permissions or Change Permissions option. Folders should read 755, which means the owner can read, write and execute, and everyone else can read and execute. Files should read 644, which means the owner can read and write, and everyone else can read only.
Two files deserve a closer look. wp-config.php holds the database credentials, so it is often set stricter than other files — 600 or 440 on many hosts — and that is correct; do not loosen it. And the .htaccess file itself must be readable by the server: if its permissions were changed to something the server cannot read, the result is a 500 on every page.
Never set anything to 777, which gives everyone full read, write and execute access: it may silence the error, but it leaves every file open to anyone who can reach the server. If a plugin or tutorial insists a folder needs 777, it is wrong — 755 is the correct permission for a folder the server needs to write to, provided the folder is owned by the right user, which is a question for the host.
If the permissions look correct and the 500 remains, move on: permissions were not the cause, and changing correct permissions to something else only adds a new problem.
Fix 7: Check the PHP version
WordPress and its plugins are written for particular PHP versions, and a site running on old PHP — or a plugin that demands newer PHP than the server provides — can fail with a 500. This is the most common cause of a 500 that appears with no change to the site itself: the host updates the PHP version on the server, a plugin that was written for the new version starts failing, or the reverse — the host leaves the site on an old PHP version while a plugin update assumes a newer one.
WordPress.org currently recommends PHP 8.3 or greater, with MySQL 8.0 or MariaDB 10.11 or greater and HTTPS support. Older PHP versions have reached end of life and may expose a site to security vulnerabilities. The practical rule: a site in 2026 should run PHP 8.3 or newer, and any plugin demanding newer PHP than the server provides needs a PHP upgrade or a different plugin.
To find the PHP version, go to Tools, then Site Health, then Info and open the Server section — it lists the PHP version alongside the memory limit. If wp-admin is down, the host's control panel usually shows the PHP version, or support can tell you in one message. If the version is below 8.3, raise it: most hosts let you change the PHP version from the control panel, and the change takes effect immediately.
Two warnings before changing it. First, test the change: a jump from a very old PHP version can break old plugins written for it, so switch, reload the site, and check the main pages — if something breaks, switch back, update the offending plugin, and try again. Second, keep a backup from before the change: a PHP version change is a server change, and it affects every site on the account.
Fix 8: Reinstall the WordPress core files
If no plugin, no theme, no memory limit and no PHP version explains the 500, the WordPress core files themselves may be damaged — usually after an update that was interrupted, or after a malware infection that modified core files. The symptom is a 500 with nothing in the debug log pointing at a plugin or a theme, or a fatal error whose file path sits in wp-admin or wp-includes.
If wp-admin loads, the easy route is built in: go to Dashboard, then Updates, and click the "Re-install Now" button. WordPress downloads a fresh copy of itself and replaces the core files, leaving your content, themes, plugins and settings untouched — the safest way to do this, because WordPress itself controls what gets replaced.
If wp-admin is down, do the same job by hand: download a fresh copy of WordPress from wordpress.org, unzip it, and upload only the wp-admin and wp-includes folders, replacing the ones already there. Do not touch wp-content — themes, plugins and uploads live there — and do not touch wp-config.php, which holds the database credentials.
After reinstalling, reload the site and check the main pages. If it loads, the core files were the problem. Then run the updates: Dashboard, then Updates — make sure WordPress, every plugin and the theme are current. If the damage was malware rather than a failed update, reinstalling core is only half the job: the infection may also have touched the theme, plugins or database. Our WordPress malware removal guide covers the full clean-up.
Fix 9: When to contact your host
Some 500 errors are not fixable from inside WordPress at all, because the cause sits on the server. If you have worked through the fixes above and the site is still showing a 500 — or you cannot reach the files or the database — contact the host's support team, and give them something useful to work with.
Contact the host when any of these apply: the error log is empty even with logging turned on, which suggests the error happens before WordPress loads; the site shows a 500 alongside a 503 status, which points at the server rather than the site; the 500 started right after a server-side change the host made; the host's control panel itself is unreachable; or the file manager and FTP both refuse access. These are server problems, and only the host can see the server's own error logs.
When you contact support, include four things: the exact address that shows the 500, when it started and what changed just before it, the last fatal error line from the log, and what you have already tried. "The site is down" gets a generic reply; "the front page shows a 500 after a plugin update, the log says PHP Fatal error in wp-content/plugins/example-plugin/file.php on line 42, and deactivating the plugin did not help" gets an engineer looking at the right thing. Paste the log line exactly — the file path and line number are the most useful part.
If the cause is still unclear, ask three questions: what does the server error log show for the time the page went down, what PHP version and memory limit is the account running, and is a server-side cache, firewall rule or security module returning the 500. The server log often holds the answer WordPress could not show you, because it records errors from before WordPress loads. A good host will also restore a server-side backup if you ask — most keep daily backups for a few days.
How to stop it happening again
A 500 error fixed is a lesson learned — if the habits that caused it change. Most 500 errors are preventable, and the prevention is routine maintenance rather than technical skill. The five habits below cover nearly every cause in this guide.
First, keep everything updated — but at the right time. Update WordPress core, the theme and every plugin when updates are available, because updates close the bugs and security holes that cause 500 errors. Do them when you have time to check the site afterwards, not five minutes before leaving the house, and never update everything at once on a site with no backup. Update, check the site, then move on. Our WordPress security guide covers the update routine, including automatic updates for minor releases.
Second, keep the plugin list short. Every active plugin is code that runs on every page load, and any one of them can produce a 500. Audit the list twice a year: deactivate and delete anything the site no longer uses, and never install two plugins that do the same job. A site with eight maintained plugins is dramatically safer than one with thirty, five of which were abandoned years ago.
Third, back up on a schedule, not on a hope. A backup plugin set to run daily and store copies off-site — on Google Drive, for example — means the next 500 error costs minutes instead of hours. Test the restore occasionally: a backup you have never restored is a hope, not a backup. The backup guide shows how to set the schedule up and test it.
Fourth, test changes on a staging copy before making them live. Most managed hosts offer one-click staging: a private copy where updates and new plugins can be tried safely. A plugin update that would have produced a 500 on the live site produces it on the staging copy instead, where nobody sees it.
Fifth, watch the basics: the PHP version, the memory limit, and the Site Health screen. Site Health — Tools, then Site Health — flags an outdated PHP version and a low memory limit before they become a 500. Checking it once a month takes two minutes and catches the slow drift that eventually breaks a site out of nowhere.
Frequently asked questions
What does a 500 internal server error mean on WordPress?
It means the web server hit an unexpected problem while building the page and stopped, without saying what the problem was. The cause is on the server side — usually a corrupt .htaccess file, a plugin or theme error, an exhausted PHP memory limit, an unsupported PHP version, or damaged core files. Your content is almost never affected, because posts and settings live in the database, not in the code that failed.
Will fixing a 500 error delete my content?
No. Posts, pages, images and settings live in the database and the uploads folder, and a 500 error does not touch them. Every fix in this guide changes code — configuration files, plugins, themes, settings or core files — not content. Back up before you start.
What is the most common cause of a WordPress 500 error?
WordPress's own errors documentation names a corrupt .htaccess file as the most common cause, followed by plugin and theme conflicts, an exhausted PHP memory limit, an unsupported PHP version, and damaged core files. Renaming .htaccess and regenerating it through Settings, then Permalinks, fixes the largest share of cases, so it is worth trying early.
Why does the 500 error appear only on some pages?
Because the fault is in something only those pages use: a shortcode in one post, a template file, a widget, or a plugin that only runs on certain pages. If the homepage fails but single posts load, look at the homepage template and its widgets; if every page fails, the fault loads everywhere — a plugin, the theme, the .htaccess file, or the core files.
How do I find the real error behind a 500?
Read the server error log in the hosting control panel, under Errors, Logs or Metrics — it usually names the exact file and line. If that log is empty, turn on WordPress debug logging in wp-config.php with WP_DEBUG, WP_DEBUG_LOG and WP_DEBUG_DISPLAY, reload the broken page once, and read the last "PHP Fatal error" line in wp-content/debug.log. Turn debug mode off and delete the log when the site is fixed.
When should I contact my hosting provider about a 500 error?
Contact your host when the error log stays empty with logging on, when the 500 comes with a 503 status, when it followed a server-side change, or when you cannot reach the files or the database. Send the failing address, when it started, the last fatal error line from the log, and what you have already tried.
A page that loads nothing at all — no error message, just white — is a different failure with different fixes: the white screen of death.
Read the white screen of death guide ↗