WinningWP content is free to all. If you make a purchase through referral links on our site, we earn a commission (learn more). Show
Tags – errors, intermediate, internal server error Fixing The Dreaded ‘Internal Server Error’ in WordPress (Step by Step)
We’ve all been there — a site that was functioning perfectly well just seconds ago suddenly decides to throw a fit and spits out an internal server error. If you’re lucky, the WordPress admin still works, but, in some cases, even that may refuse to cooperate. In this article, we’ll explain what an internal server error is, and, more importantly, how to fix it. Important: Always make a complete backup of your site (even if it’s not working as it should be) before making any changes — better safe than sorry! Let’s get cracking. What Is an Internal Server Error?Internal server errors are annoying to users and developers alike because they don’t provide any information about the root of the problem — they just tell you there is one. Imagine if you went to the doctor and said you felt pain, but refused to reveal where that pain was — it’d make it very hard for the doctor to treat it! That’s the difficulty with an internal server error — there’s no indication of where the problem’s coming from. (click to enlarge) What’s more, the name ‘internal server error’ can be misleading, because, in almost all cases, your host (and/or server) isn’t to blame. If you take a look at the HTTP specifications, you can see that an internal server error means the following:
There’s nothing wrong with the server itself — it’s simply encountered something it can’t figure out. To figure out what’s going on, you’ll need to do a little troubleshooting and trial and error. By systematically going through the things that could be going wrong, you’ll be able to figure out what’s causing the problem and, more importantly, how to fix it. How to Fix WordPress 500 Internal Server ErrorWe recommend you perform these steps in order. That is, start at Step #1 and work your way through the list. In a few situations, we’ll tell you to skip ahead based on the results of one of the steps. But, in general, go from top to bottom! Beyond that, just a reminder that we always recommend backing up your site before making any of the changes on this list. If you can’t access your WordPress dashboard to use a backup plugin, you should still be able to create a backup through your hosting dashboard — ask your host’s support for help if you’re not sure how. Now, let’s get to fixing… 0. Enable DebuggingThe first step should be to at least try to make sense of the error — you could get lucky! Depending on how your server handles errors, what you’re seeing may not actually be a server error at all. Instead, it could be an error in your site’s code (typically the code of a plugin or theme). To see whether this is the case, you’ll need to edit the
If the line already exists, change If this line isn’t in your config file, create it by adding the following line of code somewhere above the line that says
Reload your website and see if the error changes. If it does, and you now see a ‘fatal error’ message that points to a specific line of code in a specific file, then you’re looking at a relatively simple code error. Assuming said error originates from a plugin or theme, you’ll need to disable the offending product and/or work on fixing the issue yourself (or have someone else take a look at it if you’re not able to work out what’s happening on your own). Note: Once you’ve finished with this step, make sure to change the 1. Check if Your WordPress Dashboard WorksThe next step is to test whether or not you’re able to access your backend WordPress dashboard. Visit your website admin at 2. Disable All PluginsNext, it’s time to test if the issue is coming from a plugin. There’s almost no way a plugin can cause issues if it’s disabled, so the easiest way to test this is to disable all of your plugins at once. This won’t delete your plugins, nor will it make you lose any of your data (that’s still safely stored in your database). What it will do is disable their code from running, which will fix the problem if a plugin’s code is triggering the internal server error. If your WordPress dashboard is working fine, you can disable plugins by following these steps:
If you’re unable to deactivate plugins via your dashboard for some reason, you can also deactivate them via FTP by following these instructions:
If you’ve disabled all of your plugins and your site still won’t load, go to step three. If your site’s up and running, the next step is to figure out which specific plugin is causing issues. To do this, you’ll need to reactivate your plugins one by one. Keep checking for that internal server error after activating each plugin. When you’ve found the culprit, you can decide what to do with it. The best course of action is to keep the plugin disabled and notify the author immediately. If it’s a mission-critical plugin, you should probably look for a better, more stable alternative. Note: If you deactivated your plugins via FTP, you’ll need to rename the folder back to the original In some very rare cases, running old software such as PHP 5.3 may cause issues. Before replacing a plugin that’s proved to be trustworthy so far, take a look at step seven. 3. Switch to a Default ThemeIf deactivating your plugins didn’t solve the issue, your theme could also be the culprit. You can verify this by switching to a default WordPress theme. We recommend using Twenty Twenty, which is the latest default theme. If you’re still able to manage themes from your WordPress dashboard, you can do this by going to Appearance -> Themes. If you already deleted the default theme, you can reinstall it from WordPress.org. If you can’t switch themes from your WordPress dashboard, you can also perform this via FTP by following these instructions:
When you rename the folder of your active theme, WordPress will automatically fall back to the default theme (as long as the default theme is installed). If switching to Twenty Twenty solves the problem, you can re-enable all plugins and get to work finding the issue in your theme’s code. If your theme is from either the official theme repository or an independent theme shop, you should let the author know as soon as possible. If, on the other hand, it’s your own theme, you’ll need to get a developer to help you out, because these bugs can often be very difficult to find — even for seasoned coders. In some very rare cases, running old software such as PHP 5.3 may cause issues. Before spending hours trying to find a bug, or paying hundreds of dollars to a developer, take a look at step seven. 4. Increase Your Memory LimitIf your website is using too much memory, it’ll definitely throw a fit — quite possibly resulting in a 500 internal server error. In many cases, this is a sign of a badly coded theme or plugin. It can be remedied quickly by increasing the memory limit, but this isn’t a sure-fire way of solving the problem, and won’t get to the root of it. You can try to manually increase your memory limit. However, keep in mind that your server or your account may have a set amount of memory allocated to it and you won’t be able to increase your memory limit beyond that. There are a few ways you can go about increasing your limit:
For all of these files, you’ll need to edit them by connecting to your server via FTP and adding a code snippet (or changing the value of an existing code snippet if the snippet already exists). Here’s what to add: wp-config.php file Add the following code snippet above the line that says
PHP.ini Find the line that says .htaccess file Add the following line:
Alternatively, speak to your host for more specific instructions — some will be more than happy to increase your memory limit with almost no fuss on your part. 5. Debug .htaccess IssuesIf your host uses the Apache Server (which most WordPress hosts do, especially on the budget end), the We’ve already written a guide on how to edit the .htaccess file, but it’s worth reiterating that this is a sensitive area that requires caution. A typo, a forgotten space or an unclosed quote, for example, could easily cause a 500 internal server error, grinding your website — including your admin — to a halt. There’s a simple way to check if this file has errors:
If your website comes back online, then the issue is with your If you do have custom rules, you can go through the To save time, you can also use this free .htaccess syntax checker, which can automatically catch many low-level errors/typos. 6. Reinstall WordPressIt’s extremely rare, but you may have some corrupted files in the WordPress core. This isn’t anything to worry about — something may have gone wrong when your server was copying the required files, for example. Re-uploading the WordPress Core files may solve your problem. Here’s how to reinstall the core WordPress files:
7. Check for PHP Version IssuesWhile old PHP versions usually don’t cause the internal server error, it may be worth talking to your host and asking them to give you a newer version before spending valuable time and money. PHP 7 has deprecated some previous features — for example, a plugin may use a function that’s not available in older versions of PHP, and so on. Ask your host what version of PHP you’re running. As of September 2020, PHP 5.6 no longer receives any updates (not even basic security support) — don’t accept it if your host is running your site on such an old version. You should at least have some variant of PHP 7 running. Ideally, you’ll want to be on PHP 7.3+ as PHP 7.0 also no longer receives updates and even PHP 7.2 will stop receiving security fixes at the end of 2020. Nothing Working? Test for Compound ProblemsWhile it’s unlikely you’ll have two problems at once, it can happen. You may have a plugin that’s causing an issue, as well as an If you’ve followed these steps and you’re still getting a 500 internal server error, you should start again and make sure to not undo any changes. Keep your plugins disabled, keep your theme switched to Twenty Twenty, and so on. Through trial and error, you’ll be able to discover the combination of issues that are causing problems. Frustrated By Dealing With Errors? Try Managed WordPress HostingAs you can see, a lot of work goes into troubleshooting common WordPress errors such as the 500 internal server error. If you don’t want to have to deal with these issues yourself (and you’re willing to pay a little more for the convenience), moving your site to managed WordPress hosting could be a good decision. A high-quality managed WordPress host will proactively monitor for these types of errors and fix them for you to keep your site working. For example, the support staff at Kinsta, one of our recommended managed WordPress hosts, automatically receive notifications if your site is down because of an internal server error. Additionally, because these hosts offer more of a premium product, their support staff will be more willing to invest time in troubleshooting the problem for you. Of course, the downside is that you’ll definitely pay a bit more than you would for cheap shared hosting. Typically, a quality managed WordPress host starts at around $30 a month. Still, if you value peace of mind, that price may be worth it, especially for a business website where downtime means lost revenue. Final ThoughtsBecause of the vagueness of the internal server error message, resolving it can be difficult, but, by following the steps above, you should be able to eventually figure out what’s going wrong. If you still can’t solve the problem, contact your host. Link to this article and let them know you’ve tried these steps, as they’ll appreciate the effort and will be able to locate the issue a lot faster! Seen any edge cases or downright weird things happening in relation to this error? Let us know in the comments! By Colin NewcomerColin Newcomer is a freelance writer and long-time Internet marketer. He specializes in digital marketing and WordPress. He lives a life of danger, riding a scooter through the chaos of Hanoi. Related postsTOP DEALSSave up to 75% with SiteGround!Save 20% on any Themify purchase!Up to 4-months free with WP Engine!(view all deals) Comments (policy)
Leave a Reply Cancel replyYour email address will not be published. Required fields are marked * Comment Name* Email* Website
Δ All comments are held for moderation. We'll only publish comments that are on topic and adhere to our Commenting Policy. How do I fix Internal server error in WordPress?How to Fix the 500 Internal Server Error in WordPress (10 Tips). Back up your website. ... . Try reloading the page. ... . Clear your browser cache. ... . Access your error logs. ... . Check for the 'Error Establishing a Database Connection. ... . Look for permission errors. ... . Increase your PHP memory limit. ... . Check for problems with your .. What could be the reason for internal server error?The 500 Internal Server error could be caused by an error during the execution of any policy within Edge or by an error on the target/backend server. The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request.
How do I fix internal server error occurred?Reload the web page. You can do that by selecting the refresh/reload button, pressing F5 or Ctrl+R, or trying the URL again from the address bar. Even if the 500 Internal Server Error is a problem on the webserver, the issue might be temporary. Trying the page again will often be successful.
|