An error on the front end or admin section can make for a massive headache and loss of site visitors. Errors are especially frustrating if you have no idea what is causing the error. The HTTP 500 internal server error is one of the worst errors that a website owner can encounter because it could be coming from so many places! It does not offer any additional information, and it, therefore, requires hours of troubleshooting and patience. As the hours go by, your site will lose visitors, your reputation will get ruined, and your sales will dwindle.
If you experience an internal server error, you need all the information you can get, which is precisely what this piece will give you. Hopefully, you will get your website back running in no time.
First things first: What is a 500 internal server error in WordPress?
The 500 internal server error in WordPress is an alert that your site visitors get on their browsers indicating that there is a server-level error. This essentially means that your website cannot be displayed to visitors the way it should. This error is dangerous as it can damage your WP admin portal.
Contrary to popular belief, the 500 internal server error is not related to your website’s server. It is instead an issue with the root directory of your WordPress site; this means that to find the root of the issue, you will need a lot of trial and error. This error manifests in different ways depending on the browser your visitors are using, including:
- 500 internal server error
- Internal server error
- Error 500
- HTTP error 500
- HTTP error 500-internal server error
- Temporary error (500)
- Error code: 500
Regardless of what it looks like, a WordPress http error 500 on your site will tank your search engine’s rankings, reputation, traffic, and, of course, sales. Below is a guide to some effective troubleshooting techniques that you can start off to pinpoint the issue source:
1. Create a backup of your site
Before you go about solving the 500 internal server error, consider creating a site backup if you do not have one, or it has been long since you updated it. Solving the problem may require making significant changes to your site’s root directory, which is the storage area for all your WordPress files. Having a backup in place will help you make whatever changes needed without fear. Use a plugin to create an automatic backup then make a hard copy or manual backup.
2. Reload your webpage
This is the first thing you want to do; maybe your web server simply needs to clear out some cache or temporary errors. These errors occur when you update your site, use a new theme, or add a new plugin. The server may get overwhelmed, and to fix this, all you need is to reload the website. If you experience this issue often, consider finding a better WordPress hosting solution.
You can also use the website downforeveryoneorjustforme.com. Pasting your site URL onto this site will help you determine if the site is indeed down or there is a slight problem on your end.
3. Check your server logs
Your server logs can also provide insight into the main problem. These logs can provide valuable information, especially if a newly installed plugin or theme is the problem. One of the issues you may identify from your server logs is an error in establishing a connection to the databases.
This issue easily stands out because your browser will show a blank page called the White Screen of Death (WSOP). No data will be available for display due to the absence of a connection. This problem ruins your website’s front end and locks you out of your admin dashboard. Some of the reasons why a database connection may fail include:
- A corrupted WordPress database
- Corrupt WordPress files due to malicious activity
- Database malfunctions due to massive spikes in traffic. This is especially common with shared hosts.
To counter this issue. Confirm the accuracy of your login credentials or revert to your most recent backup. You can also repair a corrupt database using WordPress’ inbuilt mechanism:
4. Clear browser cache
Clearing out browser cache improves its efficiency and eliminates the possible glitches that are preventing your site from loading properly. There are plenty of remarkable and free tools you can use to wipe your browser cache.
5. Check your WP admin area
First, check if you are locked out of your WP admin by logging into your site. If you cannot log in, the 500 internal server error may be caused by a plugin or theme that is installed on your website. This trial is one sure way of quickly determining whether any recent installations are responsible for the issue.
Also Read: How To Speed Up Your WordPress Website?
6. Deactivate the culprit theme or plugin
If you are locked out of your WP admin, a theme or plugin error may be responsible, and you, therefore, need a detour to get them out. This fix is rather time-consuming but straightforward. The first step is to use FTP to find your site’s files using an FTP client like FileZilla. Download the FTP client, type in your URL as the host, then your credentials for your WP admin. Click Quickconnect, and then you will see your computer’s files on the left, then your site’s files on the right side.
Find the folder labeled ‘plugins’ then rename it to plugins_deactivate. This action will deactivate all the plugins at once. Reload your site, and if the error is resolved, you will be sure that a plugin was responsible.
You will now be able to access your WP admin. Log in then reactivate your plugins one after the other while reloading the site, till you identify the one plugin causing trouble. You can then delete it, find an alternative, or contact the plugin designer to have it fixed. You also need to get back to your FTP client to rename the plugins folder, so they remain active.
If the plugins are not the issue, try the same steps with the themes folder in your FTP client. If the theme is the issue, change it and reload.
7. Check your .htaccess file
Another issue that may crop up when you change or integrate a new theme or plugin is the corruption of the .htaccess file, thus triggering the annoying 500 internal server error. This issue is also readily fixable via your FTP client.
Locate the .htaccess file, right-click and rename it to .htaccess_old. Reload your site to check if the error is gone, and if it is, then you have found the issue. Log in to your WP admin, go to settings-permalinks, then select ‘save changes.‘ This step regenerates the original .htaccess file and eliminates the error 500.
8. Increase the PHP memory limit
Your website may be consuming too many PHP resources, and increasing it may remove the error. WordPress and your web host usually set this limit. There are several ways in which you can increase your PHP memory limit:
Via your wp-config.php file
- To increase this memory limit, visit your FTP client then locate the wp-config.php file. Right-click on it, choose View/edit, then select the default editor. Notepad will work just fine. Just before the ‘Happy Blogging’ code, add this line of code:
- Save the notepad file on your computer, locate it on the left side of your FTP client, right-click it, then hit upload. If you refresh your website and the error is gone, then you will have identified an overloaded PHP memory as the underlying issue.
Through your php.ini file
- You can find your php.ini file in your wp-admin folder within your root directory. To find your php.ini file, you need to activate the ‘show hidden files‘ option. Open it and find the code starting with ‘memory_limit.’ If it shows 64MB and below, replace it with
- memory_limit= 256M
- If you cannot find your php.ini file, you can create one yourself through notepad. Write the above line of code, then upload it to your wp-admin folder.
Through your .htaccess file
- Find your .htaccess file via your FTP client then add this line of code:
- php_value memory_limit 256M
- This action will increase your memory limit to 256 MB. Your .htaccess should be easy to find if you g=have enabled ‘show hidden files.’ If you cannot find it, create a new one, paste the code, save it as .htaccess, then upload it to your wp-admin folder.
- To ensure that this problem does not crop up in the near future, you will need to identify what is taking up so much memory. It is most likely a badly-coded plugin or theme. You can identify the culprit by seeking assistance from webhost. They will then carry out a thorough search on your server logs.
9. Check your file permissions
According to the WordPress codex, this is the protocol for file permissions:
- All directories should be set to 755 or 750
- Files should be 644 or 640, except the wp-config.php, which can be set to 400 or 440 to protect it from unauthorized access by other users on the server
- Directories can never be set to 777
If the permissions are set in any other way, a 500 internal server error could appear. You can check these permissions via your FTP client; look in your website’s directory under Permissions. If you find any folder or file set to anything other than the assigned permissions, right-click and change it to the correct number.
10. Consider reinstalling WordPress
At times, the core WordPress files can become corrupt and necessitate a fresh re-installation to replace them. This phenomenon is quite rare, but if all the methods above have not assisted, it may be the only way to eliminate the 500 internal server error. You will carry out the re-installation the same way you did the very first time: by downloading a fresh copy of WordPress from www.wordpress.org then installing it onto your site.
When the download is complete, you will find a folder named WordPress. Connect to your FTP client, find the wp-admin and WordPress folders than upload them. When prompt crops up, select overwrite; this action will effectively replace your wp-admin and wp-includes files on your site with new files. If you reload the site and find everything to be normal, you probably had corrupt core WordPress files.
11. Reach out to your webhost
If all the above troubleshooting steps do not work out, then you need to contact your WebHost. Hopefully, your web hosting services provider has a reliable customer support service; this team will quickly identify and solve the issue. One of the biggest reasons why selecting a reputable WordPress hosting service is critical is that they have the experience needed to deal with a 500 internal server error and a reliable customer support team. They can also guide you through a series of steps to rectify the issue.
12. Have a professional help in debugging your website
WordPress has an inbuilt debugging feature that you can use to determine what the main issue causing the 500 internal server error. This tool is helpful if you still cannot seem to identify the problem. Pasting some code onto your wp-config.php file facilitates this debugging, which will then record all detected malfunctions on a file in the root directory. Getting professional assistance is highly advised.
You may be aware of the code needed to start the debugging process, but may not be able to tell the serious issues from minor ones. Again, this process may expose essential code to your site visitors when your website is still live.
The 500 internal server error is frustrating mainly because it is vague and never has any clear-cut solution. The troubleshooting steps above are simple and do not require extensive coding expertise to carry out. Hopefully, you will be able to identify and solve your site’s 500 internal server errors by following them.
You may also want to consider changing your WebHost if you are on a low-cost shared hosting server. This way, you can find a service provider that will handle the demands of your rapidly-growing site.