The 500 internal server error is a common and rather unpleasant error that may occur on a website.
If you’ve ever seen this error message when opening your website, you know the feeling of frustration and maybe even panic from not knowing the reason behind it. Yes, the major problem with it is you don’t know for sure what causes the error in the first place.
500 Internal server error in WordPress can be caused by many things. If you’re experiencing one, there’s a high chance one (or more) of the following elements is causing the issue:
Unlike 503 errors, which are used for WordPress maintenance mode and tell Google to check back at a later time, a 500 error can have a negative impact on SEO if not fixed right away. If your site is only down for say 10 minutes and it’s being crawled consistently a lot of times the crawler will simply get the page delivered from cache. Or Google might not even have a chance to re-crawl it before it’s back up. In this scenario, you’re completely fine.
However, if the site is down for an extended period of time, say 6+ hours, then Google might see the 500 error as a site level issue that needs to be addressed. This could impact your rankings. If you’re worried about repeat 500 errors you should figure out why they are happening to begin with. Some of the solutions below can help.
The full name of the error explicitly points out that the issue is a server-side one. Simply put, something prevents your server from loading the files of the requested page correctly. However, you don’t get much more information from the error message itself.
If you see this worrisome message about an internal server error, it can be the result of exceeding memory limits set in your configuration files. Looking for an issue there implies code editing, but don’t worry: this is not going to be overly complicated. Stay with us, and we will show you the way.
Get ready: finding your way out requires some troubleshooting.
Before exercising any of the methods to fix the internal server error, create a backup of your website. Cloning your content and storing the copy somewhere is what will keep your website safe regardless of what you do.
There are many special plugins for creating backups (and many other ways of doing so). UpdraftPlus is a great free plugin you can use.
Creating backups is a good practice in general. You don’t want to lose any information; so, make sure you set a schedule to have everything saved.
Most of the following solutions require that you FTP into your site. If you are not familiar with what it is, in short – it is a protocol that grants you more rights for working with your root directory files.
First, you need to install an FTP client if you don’t have it yet. Choose any of the popular ones like FileZilla and download it. Once you have it installed, you need to create an FTP account.
Now that you have FTP access, you can upload and change the files in the WordPress root directory.
But, as the saying goes, with great power comes great responsibility: editing those files brings essential changes to your site. With that said, be cautious when configuring anything and try to avoid going beyond recommendations if you’re not an experienced developer.
To start fixing the problem, it is helpful to know some more specificities. There is a great debugging technique that will show you what was the cause in your case.
*A reminder for you to check if you have a backup!*
In your root directory, find the “wp-config.php” file and open it.
define('WP_DEBUG', false) line. It is set to false by default, but if you change it to true, you will get a new, more detailed error message on refresh.
Also, if you add two more lines:
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
you will have all errors listed in the debug.log file in your wp-content folder.
And: moving on with the fixing.
Not all the plugins on WordPress are compatible with each other. Sometimes the error occurs, for instance, when you try to load your Woocommerce order checkout page. This may happen due to the conflict between the plugins and/or the theme you use.
Disable all the plugins apart from Woocommerce.
If you don’t get the error message, then it was one of your plugins. Try activating them back one at a time to find out which one was the original cause. Once you’ve detected it, either find a substitute for it or contact the plugin developer.
For more recommendations on this specific issue, read the Woocommerce self-service guide.
The theme you use can also be the trigger. Here, the general pattern is the same: you disable the potential cause. Switch to the default WordPress theme and see if it solves the problem. If it does, consider changing the theme.
PHP is responsible for handling user requests. When you exceed the memory limit, you get a fatal error, because there are no resources to process that request. Your permissions may be simply too low to perform such a process.
The default memory limit set by WordPress is often below 64M (32M is quite common). To increase it, you need to change the value to a bigger one in one of the following files:
Open the file and add this:
php_value memory_limit 64M
where X is your PHP version (one digit; i.e. if you have PHP 7.3.11, put 7).
NB: leave the name unchanged; otherwise, you may disrupt some core information.
In this file, find the line that says
/* That's all, stop editing! Happy blogging. */
right above it, where X is the value you need (64, 128, etc.). If this line is already in place, change the numeric value to a bigger one.
This configuration file contains the line that starts with a memory_limit setting. Change the value that goes after it and check if it worked.
The memory_limit setting limits the memory consumed per script. That is, it is not the total memory size we configure. All scripts together can amount up to a bigger value as long as no single one of them exceeds the limit set.
You can try the most radical way – getting fresh wp-admin and wp-includes folders. Download them from WordPress.org and upload to your root directory (again, as long as you’ve saved a backup of your site).
When you’ve tried everything, but you still get the error message, it is time to contact your hosting provider. The issue can be on their side.
This is the last one on the list because when you call them, the first thing they will likely ask you is whether or not you’ve done any troubleshooting. After trying out all the fixes from above, tell them what you’ve already done. By doing so, you let them know the error isn’t the result of any of your activities.
If you’re having trouble managing your WordPress site, or it takes up too much of your time, we are here to help!
Why wasting time tinkering in ugly code structures and searching for solutions on forums when you can have professional developers doing it all for you?
Feel free to contact us and see how we can help you grow and prosper.