search ]

How to Resolve 500 Internal Server Error on WordPress Sites

500 Server Error or 500 Internal Server Error is undoubtedly one of the most frustrating issues you can encounter on WordPress sites, or any website, for that matter. A 500 error generally means “something went wrong somewhere.” Typically, you won’t get any specifics on what went wrong when this error occurs—just a blank white screen or the following error message:

500 Error on a WordPress Site - Typical Message

So, how can you identify what went wrong and fix it? Let’s walk through the steps to understand the cause of this error and how to solve it.

Quick Solutions for Server Error 500

  • Deactivate all plugins via FTP: Rename the plugins folder in wp-content via FTP to deactivate plugins. If resolved, rename it back and test plugins one by one.
  • Rename the active theme folder: Rename your theme folder in wp-content/themes via FTP. WordPress will switch to a default theme if available.
  • Check and rename the .htaccess file: Rename .htaccess to .htaccess_old in the root. If this works, regenerate it in Settings > Permalinks.
  • Enable Debug mode to find errors: Set define('WP_DEBUG', true); in wp-config.php to view error logs. Set it back to false when done.
  • Increase PHP memory limit: Add define('WP_MEMORY_LIMIT', '256M'); in wp-config.php or adjust it in your hosting control panel.

Let’s dive into each of these possible solutions to troubleshoot the 500 error effectively:

Is a Plugin Causing the 500 Error?

If you just installed a new plugin, or if your site displays a 500 error after updating or upgrading WordPress, it’s likely that the issue is due to that plugin or one of the installed plugins on your site. Identifying the faulty plugin is simple if you just installed a plugin and received the error afterward. But how can you disable the plugin if you don’t have access to the WordPress admin? And what if you don’t know which plugin caused the error?

In both cases, you need FTP access, although a file manager in cPanel or Plesk will also help in this situation. If you know which plugin caused the issue, simply navigate to the wp-content/plugins folder and delete the plugin. If you’re unsure which plugin is causing the error, rename the plugins folder.

Just add an underscore at the beginning, like this example (“_plugins”):

Is a Plugin Causing the 500 Error?

Renaming the folder will disable all plugins on your site at once, allowing you to access the WordPress admin interface if a plugin is indeed the problem. In this case, you will receive notices in WordPress, like:

"The plugin something.php has been deactivated due to an error: Plugin file does not exist."

Don’t worry, the settings for all those plugins are stored in the database, and most plugins will return as before once reactivated. The next step is to rename the folder back to its original name by removing the underscore, then activate each plugin one at a time until you find the problematic one. Once the site shows a 500 error again, repeat the process but do not reactivate the faulty plugin.

Is the 500 Error Caused by a Theme Issue?

If disabling plugins didn’t work, the issue might be with the active theme on your site. Similarly to plugins, start by renaming the themes folder using FTP, which will activate WordPress’s default theme. This is one reason why you should keep the default theme available on your site.

The theme folder is named themes and is located in the wp-content directory.

500 Error Caused by Active Theme Issue

If you still encounter a 500 error and can’t access the WordPress admin interface, proceed to the next steps. If the issue is resolved and you can access the admin, the problem was with the theme you were using. At this point, if you didn’t modify the theme to cause the issue, you might consider finding a new theme, contacting the theme developer for help, or trying to fix the problem yourself.

To troubleshoot yourself or provide more information to the theme developer, refer to the section below on enabling Debug Mode in WordPress.

Could an Issue with the .htaccess File Cause a 500 Server Error?

If disabling plugins and the theme didn’t resolve the issue, the problem may lie in the .htaccess file—often the culprit when you can access the admin interface but not the site itself.

The .htaccess file manages (among other things) the conversion of permalinks to standard WordPress URLs.

To check if this file is the problem, use FTP to navigate to the root directory where WordPress is installed and rename the file to htaccess_old. If you don’t see the file in the folder, enable viewing hidden files (the method varies between FTP programs).

Once you’ve renamed the file, go to Settings > Permalinks in the WordPress admin and click Save without making any changes.

Is Your Site Out of Memory?

On shared servers, you might reach a point where there’s insufficient memory for your site (PHP Memory Limit). WooCommerce sites, forums, or even certain plugins can consume a lot of memory due to their complexity. In this case, you might receive an error message like:

"Fatal Error: Allowed memory size of xxx bytes exhausted".

You can resolve this by adding the following line to the wp-config.php file:

define('WP_MEMORY_LIMIT', '256M');

However, most hosting providers won’t let you change the memory limit on shared hosting. In such cases, you may want to upgrade to a more powerful server.

If you’re using Elementor, the minimum memory required is 256M. For better performance, it’s recommended to set it to 512M (for Elementor alone, not including memory required by other plugins). Many sites using multiple plugins with Elementor require a memory limit of 768M.

Try to Identify the Problem by Enabling Debug Mode

You can enable Debug Mode in the WordPress configuration file (wp-config.php). With Debug Mode on, you may get clues about the cause of the issue, but troubleshooting might require some coding skills.

The wp-config.php file is located in the root directory where WordPress is installed.

To enable Debug Mode, edit the file and look for this line:

define( 'WP_DEBUG', false );

If traffic to your site is low or you don’t mind users seeing error messages during your testing, change false to true. This will display any errors directly on the page you’re accessing.

If you prefer to keep error messages private, add these lines after the previous line:

define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

This will log errors in a file named error.log located in the wp-content folder.

Enabling Debug Mode and Displaying PHP Errors in WordPress

If you don’t see this file after a short time, WordPress may lack permission to create it. In this case, create the file manually and set its permissions to 666. In the log file, look for lines containing “PHP Error” to determine which file is causing the issue.

Note: Look for “PHP Error” as mentioned, not “PHP Notice.”

Remember! This file will grow as every error is logged, so remove these lines from wp-config.php once your debugging process is complete.

500 Server Error Due to Incorrect Server Settings

If you’re running your own server (VPS) and have changed any server settings, or if you installed an extension on the server, this might be causing the 500 errors on your site.

Internal Server Errors can result from incompatible server settings. If you’re using a managed server, this is probably not the issue, but if you’re responsible for your server’s configuration, ensure there are no compatibility problems.

Conclusion

The best protection against any critical issue on WordPress sites is daily backups, as well as a manual backup before making significant changes (like upgrading WordPress). Also, keep WordPress and the plugins you use up to date.

Good luck, and feel free to ask questions! 🙂

1 Comments...
  • Roee Yossef 17 December 2022, 11:05

    Hey Guys,

    This is my first post in english, expect more to come as i translate the rest of the blog posts from Hebrew to English 🙂

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!