Copy link
HTTP Error 500, also known as Internal Server Error in WordPress, is an error that occurs on a server. This is a general error, though it cannot tell exactly what is wrong with the server. It may be arising from several causes such as conflicts caused by plugins and themes, corrupted.htaccess files, PHP memory limits and, many more. This guide will see to troubleshooting and can help fix HTTP Error 500 in WordPress.,
corrupted.htaccess
i. Before making any changes, it’s crucial to back up your WordPress website. This includes both the files and the database.
ii. Use a backup plugin or manually back up the files via FTP and the database via phpMyAdmin.
phpMyAdmin
iii. Ensure the backup is stored safely on your local computer or in cloud storage.
Sometimes, the error is caused by exhausting the PHP memory limit.
2.1 Edit wp-config.php
wp-config.php
i. Access your site files via FTP or your hosting control panel’s file manager.
ii. Locate the wp-config.php file in the root directory of your WordPress installation.
iii. Add the following line before the line that says /* That's all, stop editing! Happy publishing. */:define('WP_MEMORY_LIMIT', '256M');
/* That's all, stop editing! Happy publishing. */:
define('WP_MEMORY_LIMIT', '256M');
iv. Save and upload the file back to your server.
2.2 Check if the Error is Resolved
A plugin conflict is a common cause of the 500 error.
3.1 Access the Plugins Folder
i. Go to your WordPress installation directory via FTP.
ii. Navigate to wp-content/plugins.
wp-content/plugins
3.2 Rename the Plugins Folder
Rename the plugins folder to something like plugins_old. This will deactivate all plugins.
plugins_old
3.3 Check Your Site
i. If the error is resolved, one of the plugins is the cause.
ii. Rename the plugins_old folder back to plugins, and then reactivate each plugin one by one from the WordPress dashboard to identify the problematic plugin.
The issue could be with your WordPress theme.
Via FTP, navigate to wp-content/themes.
wp-content/themes
4.2 Rename Your Active Theme Folder
i. Rename the folder of your active theme to something like theme_old.
theme_old
ii. WordPress will automatically switch to a default theme like Twenty Twenty-Three.
4.3 Check Your Site
If your site works now, the problem is with your theme. Consider updating or replacing the theme.
The .htaccess file which may be corrupted can cause a 500 error.
.htaccess
5.1 Locate and Rename .htaccess
i. In the root directory of your WordPress installation, find the .htaccess file.
ii. Rename it to .htaccess_old.
.htaccess_old.
5.2 Regenerate.htaccess
i. Log in to your WordPress dashboard, go to Settings > Permalinks, and click “Save Changes” without altering anything.
ii. This will generate a new .htaccess file.
5.3 Check Your Site
If this resolves the error, the issue was with the .htaccess file.
htaccess
To get more information about what’s causing the error, enable debugging.
Add or modify the following lines in wp-config.php:
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);
This will log errors to a debug.log file in the wp-content directory.
wp-content directory
6.2 Review the Log
Access the debug.log file in wp-content via FTP to identify the exact issue.
wp-content
If the problem persists, corrupted WordPress core files might be the cause.
7.1 Download a Fresh Copy of WordPress
Download the latest version of WordPress from WordPress.org.
7.2 Replace Core Files
Extract the files and upload the wp-admin and wp-includes directories via FTP to your WordPress installation, replacing the existing ones.
wp-admin
7.3 Check Your Site
This step will not affect your content but can fix any corrupted core files.
WordPress HTTP Error 500 is extremely generic to avoid and rather difficult to troubleshoot. But with these steps, you’ll find and solve the problem. So always remind yourself that before trying changes around, it’s good to have a backup of your site from avoiding possible losses.
WordPress Documentation
Or copy link