What causes a 500 error in WordPress
The error is generic: the server could not run the page. In WordPress, it is almost always one of these.
- A broken
.htaccessfile, often after a plugin or permalink change. - A plugin or theme with a PHP error, often right after an update.
- A PHP memory limit too low for your plugins.
- Wrong permissions on files or folders.
- A PHP version your WordPress, plugins or theme do not support.
- Damaged WordPress core files, after a failed update.
Read the error log
The log names the file and line that failed, and so which fix below you need. An .htaccess mistake shows in cPanel’s Errors list, not in the WordPress log.
- In cPanel, open Metrics › Errors. It lists the latest errors for your sites.
- In File Manager, look for a file named
error_loginpublic_htmlorwp-admin. PHP writes its errors there on many cPanel servers. - For the WordPress log, edit
wp-config.php, finddefine( 'WP_DEBUG', false );and changefalsetotrue. If there is no such line, adddefine( 'WP_DEBUG', true );above the “stop editing” comment. - Below it, add
define( 'WP_DEBUG_LOG', true );anddefine( 'WP_DEBUG_DISPLAY', false );, then save. - Reload the page, then open
wp-content/debug.log. - When you are done, set
WP_DEBUGback tofalse, remove the two lines you added and deletedebug.log. Anyone can open it in a browser.
Reset the .htaccess file
The quickest fix to try. Renaming the file keeps it, so you can put it back.
- Sign in to cPanel, open File Manager and go to the folder WordPress is in, usually
public_html. - If you do not see
.htaccess, click Settings, tick Show Hidden Files (dotfiles) and click Save. - Rename
.htaccessto.htaccess-oldand reload your site. - If the error stays, rename
.htaccess-oldback to.htaccess. The cause is elsewhere. - If the site loads, sign in to WordPress, go to Settings › Permalinks and click Save Changes. WordPress writes a new
.htaccess. - If WordPress cannot write the file, create
.htaccessin the same folder with the default rules for a site at the domain’s root:# BEGIN WordPress
<IfModule mod_rewrite.c>
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]
</IfModule>
# END WordPress - Copy any rules you still need from
.htaccess-old, such as an HTTPS redirect, into the new file, outside the WordPress lines. - If you set your PHP version in MultiPHP Manager, set it again there. cPanel keeps that setting in
.htaccess.
Turn off plugins and the theme
A plugin or theme update is a common trigger. If you can sign in to WordPress, turn plugins off under Plugins. If you cannot, use File Manager.
If WordPress shows “There has been a critical error on this website” instead, see how to fix a WordPress critical error.
- In File Manager, open
wp-contentand renamepluginstoplugins-old. - Reload your site. If it loads, a plugin is the cause.
- Sign in to WordPress and open Plugins. WordPress turns off every plugin it cannot find.
- Rename the folder back to
plugins. - Turn plugins on one at a time, reloading your site after each.
- When the error returns, rename that plugin’s folder to turn it off. Then update it, replace it or ask its developer.
- If no plugin is the cause, go to Appearance › Themes and activate a default theme, such as Twenty Twenty-Five.
- If you cannot sign in, rename your theme’s folder in
wp-content/themes, then sign in and open Appearance › Themes. WordPress switches to a default theme, if one is installed.
Check PHP memory and version
A site that runs out of memory, or runs on a PHP version its code does not support, can stop with a 500 error.
- Edit
wp-config.phpand adddefine( 'WP_MEMORY_LIMIT', '256M' );above the “stop editing” comment. - If the error stays, raise
memory_limitin cPanel’s MultiPHP INI Editor, or under Select PHP Version › Options, for example to256M. Full steps: how to increase the WordPress memory limit. - If the error started after a PHP version change, switch back in cPanel’s MultiPHP Manager, or Select PHP Version.
- Update WordPress, your plugins and your theme, so they support current PHP versions.
Check file permissions and core files
Wrong permissions can stop the server from reading a file, or make it refuse to run one. Core files damaged by a failed update can break every page.
- In File Manager, check the Permissions column: folders should be
755and files644. - To change one, select it, click Permissions, enter the number and click Change Permissions.
- Never use
777. It is unsafe, and many servers return a 500 error for it. - If the log points to
wp-adminorwp-includes, back up your site first in cPanel › Backup. - Download the same WordPress version from wordpress.org and upload its
wp-adminandwp-includesfolders over yours. - Never replace
wp-content. It holds your themes, plugins and uploads. - Still stuck? Open a ticket with your host. Give the page address and the exact time of the error, so support can find it in the server logs.
WordPress hosting on LiteSpeed
HostUpIndia WordPress hosting comes with WordPress pre-installed on LiteSpeed, NVMe storage, cPanel and free SSL. Daily backups are kept 30 days, so you can restore a copy from before the error.
From ₹149 a month on 3-year billing. Prices exclude 18% GST. See WordPress hosting plans.
- Support tickets and email are received 24 hours a day, 7 days a week.
- Free website migration by our in-house team.
- Browser says “too many redirects” instead? Fix the redirect loop.
- Pages show “Not Found”? Fix the WordPress 404 error.
- More help guides.
