WordPress 500 error: find the cause and get the site back online
The 500 error (Internal Server Error) and its WordPress counterpart "There has been a critical error on this website" mean that PHP crashed before it could produce a page. The message shown to visitors is deliberately vague: the real cause is in the server error logs or in WordPress debug mode.
In the vast majority of cases it is a PHP fatal error triggered by a plugin or theme after an update, an incompatibility with the PHP version, insufficient memory or a corrupted .htaccess file. The site may be completely down, or the error may only affect one page or the admin.
This page gives you the method to read the actual error message, the list of the most frequent causes with their fix, and the situations where it is better to hand the job to a professional rather than risk making things worse.
Typical symptoms
- Blank page with "Internal Server Error", "HTTP ERROR 500" or "This page isn't working".
- Message "There has been a critical error on this website. Please check your site admin email inbox for instructions".
- The error appears right after updating a plugin, a theme, WordPress or the PHP version.
- Only the admin (wp-admin) is failing, or only one specific page (cart, form, single post).
- The error is intermittent: the site works, then drops to 500 under load or at regular intervals.
- The error_log file grows quickly at the site root or in the wp-admin folder.
Possible causes
Fatal error in a plugin or theme
Undefined function, conflict between two plugins, code incompatible with the WordPress or PHP version. This is the number one cause after an update.
Incompatible PHP version
Moving from PHP 7.4 to 8.x without checking compatibility crashes plugins that use removed functions. Conversely, some recent plugins require a minimum PHP version.
Insufficient PHP memory
The message "Allowed memory size of ... bytes exhausted" in the logs means the memory_limit has been reached, often during imports, image generation or on heavy themes.
Corrupted .htaccess file
A badly written rule added by a security, caching or redirect plugin makes Apache fail before PHP is even executed.
Wrong file permissions or owner
After a migration or restore, files owned by the wrong user or folders unreadable by PHP-FPM trigger 500 or 403 errors.
Overloaded server or failing PHP-FPM
Too many PHP processes, a full php-fpm pool, an exceeded timeout or a full disk produce intermittent 500 and 502/503 errors.
Corrupted or unreachable database
A damaged wp_options table or a MySQL refusing connections can produce a critical error rather than the classic "Error establishing a database connection".
Checks to perform
- 1
Read the recovery email
Since WordPress 5.2, an email is sent to the admin address with the exact error message, the offending file and a link to open the admin in recovery mode with the culprit plugin disabled.
- 2
Enable debug mode
In wp-config.php, add define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false); then reload the page. The full message appears in wp-content/debug.log without being shown to visitors.
- 3
Check the server logs
Look for an error_log file at the root or in wp-admin, or check the host's logs (cPanel, Plesk) and, over SSH, /var/log/apache2/error.log, /var/log/nginx/error.log or the php-fpm log. The last "PHP Fatal error" line usually names the responsible file.
- 4
Test the .htaccess
Rename .htaccess to .htaccess.old over FTP. If the site comes back, the file was the cause; regenerate it from Settings > Permalinks by saving without changing anything.
- 5
Disable all plugins
Without admin access, rename the wp-content/plugins folder to plugins.old over FTP or SSH. If the site comes back, restore the original name then rename plugins one by one to find the culprit.
- 6
Check memory and PHP version
Add define('WP_MEMORY_LIMIT', '256M'); in wp-config.php and check the PHP version in the hosting panel. Temporarily going back to the previous version confirms an incompatibility.
- 7
Check the server state
Over SSH: df -h (full disk), free -m (memory), and systemctl status php8.2-fpm or equivalent to verify the PHP service is running.
Solutions
Disable or fix the offending plugin
Once the file is identified in the logs, disable the plugin or theme concerned, update it or roll back to the previous version, then contact its author if the bug persists.
Adjust the PHP version
Pick the most recent version compatible with all your plugins. Test it on a staging copy before applying it to production.
Increase PHP memory
Raise memory_limit in php.ini, .user.ini or through your host, and WP_MEMORY_LIMIT in wp-config.php. If one script uses an abnormal amount of memory, that script is what needs fixing.
Regenerate the .htaccess
Start from the standard WordPress .htaccess, then reintroduce the rules added by plugins one at a time to identify the one that breaks Apache.
Restore permissions and ownership
Files at 644, folders at 755, wp-config.php at 640 or 600, all owned by the user running PHP (chown -R www-data:www-data on a typical Debian server).
Address the server cause
Free up disk space, adjust php-fpm pm.max_children settings, raise timeouts or resize the server if the 500 errors are load-related.
When should you call a professional?
- The error message names a theme file or a custom plugin and you do not know how to fix the PHP code.
- The site is a WooCommerce shop or a high-traffic site and every minute of downtime is expensive.
- The error is intermittent and the logs do not point to an obvious culprit: server diagnosis requires tools and experience.
- You have no FTP or SSH access, no recent backup or you are worried about making things worse.
- The 500 error appeared after a hack or at the same time as unknown files.
How Agencei can help
- 1
Fast diagnosis
Review of PHP, Apache/Nginx and WordPress logs, controlled activation of debug mode and identification of the responsible component, usually within the hour.
- 2
Getting back online
Disabling or fixing the offending component, adjusting the PHP or server configuration, targeted restore if needed.
- 3
Lasting fix
Plugin update or replacement, custom code fix, adaptation to the target PHP version, regeneration of a clean .htaccess.
- 4
Full verification
Testing the whole site (pages, forms, checkout, admin), file integrity check to rule out a compromise.
- 5
Prevention
Setting up a staging environment, automatic backups and a tested-update policy so the error does not come back.
Frequently asked questions
Where do I find the exact error message?
In the recovery email sent by WordPress, in wp-content/debug.log once WP_DEBUG_LOG is enabled, or in the server error logs (error_log, Apache/Nginx logs, php-fpm log). The vague message shown to visitors is never enough.
Does a 500 error mean the site has been hacked?
Rarely. It is most often a bug or an incompatibility after an update. But if the error comes with unknown files, redirects or a Google warning, the site's integrity needs checking.
Can I just restore a backup?
It is a valid option if the backup is recent and you accept losing the changes made since. It does not fix the cause, though: the same update will trigger the same error.
Why does the error only affect the admin?
Some plugins only load their code in wp-admin, or the admin exceeds the memory limit while the public site, served from cache, stays visible.
How long does it take to fix a 500 error?
When the cause is a plugin or the .htaccess, often less than an hour. Intermittent cases tied to the server or the database can require several hours of analysis.
Related services
WordPress Troubleshooting
White screen, 500 error, hack, broken after an update: fast diagnosis and recovery.
See this serviceBug Fixing
Reproduction, root cause and tested fix on your web, mobile, API and CMS applications.
See this serviceWordPress Maintenance
Tested updates, verified backups, monitoring and security for a WordPress site that stays available.
See this serviceIT Support
Application and server support, incident handling and clear service commitments.
See this serviceTell us about your project
Describe your need in a few lines: we come back to you with a first analysis and the next steps.