Introduction
Ran into WordPress 500 Internal Server Error? Well, you’re not alone! 500 Internal Server Error is one of the most common issues that WordPress webmasters encounter. However, catching the real bug behind this error is not as easy as commonly encountered 404 error, where the possible reasons are broken permalinks or changed page URLs.
The most common reasons behind Internal Server Error are corrupted .htaccess files, incorrect file permissions, script timeouts, incompatible PHP version, or WordPress updates. However, there can be many other reasons behind this issue. Therefore you will need to dig a bit deeper to investigate the real cause. One of the best things to do when troubleshooting WordPress Internal Server Error is to trace back your steps. Try remembering what specific event caused your WordPress site to stop functioning (for example, after a plugin/theme installation or update). Once you know exactly what caused the error, solving it will be much easier.
Nevertheless, we got you! Here is a quick tutorial on fixing WordPress internal server error using 9 different methods. Stay assured, this tutorial deals with all possible solutions and is sure to solve the error. Without wasting any time further, let’s get started with this WordPress tutorial.
P.S. Safety always comes first. Before proceeding with this tutorial, we recommend making a backup of your site to prevent file loss.
Option 1: WordPress 500 Internal Server Error due to plugins or themes
In a lot of cases, WordPress 500 Internal Server Error occurs after installing or updating plugins or themes. In case you have an idea of which WordPress plugin or theme caused the issue, you are already halfway there.
Option 1.1: WordPress 500 Internal Server Error due to plugin installation or update
If your page broke down after a new plug installation or update, you can fix it by deactivating or removing the plugin. Depending on the situation, there are two ways to do it.
Deactivating plugins via WordPress Dashboard.
If your WordPress Dashboard is still accessible, follow the steps given below:
- Log in to your WordPress Dashboard.
- Click on Plugins > Installed Plugins from the left navigation menu.
- Deactivate the problematic plugin.
- Refresh the website in the browser to check if it fixed the problem.
- If not, deactivate another plugin and repeat the process until all plugins are deactivated (or until the website is working).
- Once you find the plugin responsible for the 500 internal server error, try removing and installing it again. You may also look for substitute plugins that perform the same function or contact the plugin developers/community to check why the plugin is incompatible with your WordPress environment.
Deactivating WordPress plugins via File Manager or FTP
There are situations when the error causes your dashboard not to work. In such cases, you can disable or remove plugins with the help of File Manager located in your hosting control panel or FTP client such as FileZilla.
- Navigate to your WordPress root directory and enter the wp-content/plugins directory.
- Locate the problematic plugin and rename its directory to turn it off. For example, you can add .disabled at the end so that you would not forget which plugins were disabled. If you wish to remove it entirely, simply delete the plugin directory.
- After that, refresh your website. In case the problem persists, proceed with the process until all plugins are deactivated (or until the site is functional).
- Once you locate the plugin which caused the error, you may try re-installing it, looking for a substitute plugin, or contacting the plugin creators to find out how to implement it on your WordPress website.
Option 1.2: WordPress 500 Internal Server Error due to new theme installation or update
If your page broke down after a new theme installation or update, you can deal with the issue by changing your theme. There are two ways to do it depending on the situation.
Changing theme via WordPress Dashboard
In case you are able to access the admin area, here is what you should do:
- Navigate to Appearance > Themes section.
- Choose any other theme and click Activate to use it.
- Once everything is done, you will see a confirmation screen with a link to your website.
Changing theme via phpMyadmin
Alternatively, you may change your theme by editing your MySQL database via phpMyadmin found in the hosting control panel. This can be useful in your WordPress dashboard is not working. Here’s what you should do:
- Locate your wp_options table and access it.
Depending on your installation, the prefix may not always be wp_
- Navigate to Page 2.
- Look for sections template and stylesheet
- Find out what themes you can use instead of your current one by navigating to wp-content/themes directory using File Manager.
- Copy the name of the theme that you wish to use. Next, change template and stylesheet values in the database with your theme name. In this example, we will change the theme from twentyfifteen to twentysixteen
Now, you may reload your site in the browser and it will load with the new theme. If 500 Internal Server Error was caused by your WordPress theme, this solution will fix it. You may then try re-installing your old theme or contacting the theme developer/provider for more information on how to implement it.
Option 2: Checking .htaccess file
Another option to get rid of internal server error is to check your current .htaccess file. Probability is high that your current .htaccess file is corrupted. This could happen due to a range of reasons; the most common being an installation of a new plugin or other changes on your website.
The best way to check if your current .htaccess file is corrupted is by making a new one. All you need to do is:
- Log in to your hosting control panel and access File Manager located in the Files section. Alternatively, it is possible to use an FTP client such as FileZilla.
- Navigate to the root directory of your WordPress site (If you are able to locate files like wp-content and wp-includes, you are at the right place.)
- Look for .htaccess file here and disable it. This can be done by giving the file a different name. For example .htaccess1
- After that, create a new .htaccess file and try uploading the default WordPress .htaccess code, which is:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
- Make sure to Save the file.
Now, open your website in a browser and see if the error is fixed. If not, follow the option given below.
Option 3: Increasing PHP limits
If the above two steps didn’t work for you, memory outage or insufficient PHP values can be another probability behind WordPress 500 internal server error. This is because scripts and plugins require a certain amount of memory to function properly. In addition, when your website loads, the browser makes a significant number of requests to load your plugins, scripts, and content. When there is an insufficient amount of memory available for the plugins and scripts to load, the WordPress website is likely to throw a 500 Internal Server Error. Thus, it is important to boost your website’s memory and other PHP values. You may increase them with the help of .htaccess file. Here are the lines that we recommend adding:
php_value upload_max_filesize 128M php_value post_max_size 128M php_value max_execution_time 300 php_value max_input_time 300 php_value memory_limit 256M
Don’t forget to Save your changes. Once done, refresh your website. If the issue was related to insufficient PHP values, this solution will tackle the error.
Option 4: Changing PHP version
Some WordPress plugins and scripts require a specific PHP version. If the requirements are not met, 500 Internal Server Error may appear. You may test whether the issue is related to your PHP version by changing it. This can be performed via hosting control panel’s PHP Configuration section.
In case you do not know what PHP version is needed, try all of them. Don’t forget to Save your settings and refresh the website after each change. In case neither of these selections fix the 500 Internal Server Error, change your PHP version to the initial one (which was used at the beginning) and proceed to the next option.
Option 5: Enabling error display
Finding the reason for WordPress 500 Internal Server Error is probably the toughest part while fixing it. If none of the above options helped you, you may need to investigate deeper by checking your errors. There are a few ways to do it:
Enabling display of errors
By enabling error display, you may be able to find a specific part in your code that causes the issue. This can be done via PHP Configuration section on your hosting control panel. Set the Display Errors value as Enabled and press Save.
Now, you should refresh your website. Any errors in the code will be displayed on the screen as shown below:
Alternatively, you may create a separate error log file and generate entries to it with the help of .htaccess.
Once you locate the error, you can open the file mentioned in the error and look at the specified line for more information. You may also use Google, Stackoverflow, WordPress Forums, or contact your developer for more information on how to resolve it.
Option 6: Using WordPress debugging
WordPress has it’s own special debugging system, therefore you can use it to troubleshoot issues with your code. It can also help while solving WordPress 500 Internal Server Error. To begin using it, you will need to make a few changes in your wp-config.php file first.
- Locate the following line in your wp-config.php file
define('WP_DEBUG', false);
- Remove it and paste the following code in its place:
// Enable WP_DEBUG mode define( 'WP_DEBUG', true ); // Enable Debug logging to the /wp-content/debug.log file define( 'WP_DEBUG_LOG', true ); // Disable display of errors and warnings define( 'WP_DEBUG_DISPLAY', false ); @ini_set( 'display_errors', 0 ); // Use dev versions of core JS and CSS files (only needed if you are modifying these core files) define( 'SCRIPT_DEBUG', true );
- Refresh your website and open up File Manager. Navigate to the wp-content directory and look for debug.log file. To see the generated entries, open the file in editing view.
- Now, you know the errors which are causing issues for your WordPress website and can solve them with the help of your developer, Google, Stackoverflow, or WordPress Forums.
Option 7: Restoring a backup
In case you backed up WordPress when it was functional, restoring the backup is also a solution. Firstly, remove all your WordPress site files. Then, re-upload your content and re-check whether the website works.
If you are not a fan of restoring WordPress backups manually, we may offer a great solution. Unfortunately, it will not help if your site is not functional, but it can surely help avoiding similar issues in the future.
- Install and activate All-in-One WP Migration plugin.
- Find the plugin in your WordPress Dashboard and select Export function.
- Choose the File option if you wish to download the generated backup directly to your computer.
- Download the generated backup and store it locally. It will include both your files and database.
- In case you encounter 500 Internal Server Error (or any other issue) and cannot fix it, you can simply restore your generated backup.
- To restore a backup generated by All-in-One plugin, you will need to completely remove your current website and install a new WordPress site along with All-in-One plugin. After that, choose the Import feature, select your generated backup file and proceed with the restoration.
Option 8: Re-uploading core WordPress files
If nothing seems to go right, there is a more drastic resort to fix the error. All you need to do is:
- Download the latest version of WordPress
- Save and unzip it on your computer.
- Delete wp-config-sample.php file and wp-content folder to avoid overwriting any important data.
- Move all the core files to your site’s location and overwrite them. This can be done with the help of FileZilla FTP client.
- Finally, you will be prompted with a confirmation screen. You can also select the options shown in the below screenshot. That way, there will be no need to confirm the overwriting process for each file.
P.S. Make sure that you have already taken a full backup of your current website before proceeding this option to avoid any file loss.
The uploading process may take 10-20 minutes. Once completed, try refreshing your website. If WordPress 500 Internal Server Error was caused by an issue in your core files, this option will definitely help you fix it.
Option 9: Starting from scratch
If all of the above options failed to solve your error, it is possible to start creating your site from the beginning. The great news is that it is possible to fully restore a WordPress site just by having a backup of your MySQL database.
Conclusion
Everyone who uses WordPress has encountered an internal server error at least once. Whether you are an advanced developer, or a beginner user, fixing WordPress 500 Internal Server Error is easy if you know where to look. Similarly as in real life, to solve an issue, you will first need to find what caused it. After that, you can use online resources, ask help from friends, developers or your hosting provider.