search ]

How to Fix 500 Internal Server Error on WordPress Sites

500 Server Error or 500 Internal Server Error is 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 on the server.” You typically 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.
  • Check server error logs: Review the error log in your hosting control panel (e.g., cPanel > Metrics > Errors) for specific PHP errors that point to the exact cause.

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

Check Your Server Error Logs First

Before making any changes, check your server’s error log. Most hosting providers give you access to error logs through cPanel (Metrics > Errors), Plesk, or a similar control panel.

The error log often contains the exact PHP error, file path, and line number that caused the 500 error. This can save you significant time compared to trial-and-error troubleshooting.

Always check the server error log before disabling plugins or themes. A single line in the log can tell you exactly which file and which line caused the error, saving you from guessing.

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, the issue is likely caused by that plugin or one of the installed plugins on your site.

Identifying the faulty plugin is simple if you just installed one 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 work. If you know which plugin caused the issue, navigate to the wp-content/plugins folder and delete or rename the plugin folder.

If you’re unsure which plugin is causing the error, rename the entire plugins folder. Just add an underscore at the beginning, like this (“_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 see 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 to their previous state 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 help, the issue might be with the active theme on your site. Similarly to plugins, start by renaming the theme’s folder using FTP, which will cause WordPress to fall back to a default theme.

This is one reason why you should always keep a default theme (like Twenty Twenty-Five) 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 yourself, you might consider contacting the theme developer for help, finding a new theme, 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. This is 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. WordPress will generate a fresh .htaccess file automatically.

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 see 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, Elementor recommends 512M or higher. Sites using multiple plugins alongside Elementor may need 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 debug.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.

PHP Version Incompatibility

If none of the steps above resolved the issue, your PHP version may be incompatible with your WordPress installation, theme, or plugins.

WordPress 6.9 recommends PHP 8.3 or higher. If your server runs an older PHP version, some plugins or themes may trigger fatal errors. Conversely, if your host recently upgraded PHP, older plugins that haven’t been updated may break.

Check your current PHP version in your hosting control panel and try switching to a different version. If you’re on PHP 7.4 or 8.0, try upgrading to 8.2 or 8.3. If you recently upgraded and the error started, try reverting to the previous version temporarily while you update your plugins and theme.

Incorrect File Permissions

WordPress requires specific file permissions to function correctly. If permissions are set incorrectly – whether too restrictive or too permissive – it can trigger a 500 error.

The recommended permissions for WordPress are:

  • Folders: 755
  • Files: 644
  • wp-config.php: 600 or 640

You can check and fix permissions via FTP or SSH. If you’re on shared hosting, your host’s support team can usually reset permissions for you.

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 managed hosting, this is probably not the issue. But if you’re responsible for your server’s configuration, ensure there are no compatibility problems with PHP modules, Apache/Nginx settings, or recently installed extensions.

FAQs

Common questions about the 500 Internal Server Error in WordPress:

What does a 500 Internal Server Error mean?
A 500 error is a generic server-side error. It means something went wrong while the server was processing your request, but the server can't be more specific about what the problem is. In WordPress, it's usually caused by a plugin conflict, a corrupted .htaccess file, a PHP memory limit, or a PHP error in your theme or plugin code.
Can a 500 error fix itself?
Sometimes, yes. If the error is caused by a temporary server overload or a brief resource spike, it may resolve on its own once the server recovers. However, if the error persists for more than a few minutes, it's almost certainly caused by a configuration issue that requires manual troubleshooting.
Will I lose my data if I get a 500 error?
No. A 500 error does not delete or corrupt your data. Your database, posts, pages, and media files remain intact. The error only prevents the server from generating and serving pages correctly. Once you fix the underlying cause, everything will be back to normal.
How do I fix a 500 error if I can't access the WordPress admin?
Use FTP or your hosting provider's file manager to access your site files directly. From there, you can rename the plugins folder to disable all plugins, rename your theme folder to switch to a default theme, rename .htaccess, or edit wp-config.php to enable debug mode. You don't need WordPress admin access for any of these steps.
Does a 500 error affect SEO?
If the error is brief (a few minutes), it's unlikely to affect your rankings. However, if your site returns 500 errors for an extended period, search engines will eventually stop serving your pages in results. Google will retry crawling, but prolonged downtime can lead to deindexing. Fix the error as quickly as possible and monitor Google Search Console for crawl errors.
Should I contact my hosting provider about a 500 error?
Yes, if you've tried the troubleshooting steps in this guide and the error persists. Your host can check server-level logs, PHP configuration, and resource limits that you may not have access to. They can also verify whether the issue is specific to your account or a broader server problem.

Summary

The best protection against any critical issue on WordPress sites is regular backups – both automated daily backups and a manual backup before making significant changes like upgrading WordPress or switching themes.

Keep WordPress, your theme, and all plugins up to date. Use a WordPress maintenance routine to catch problems early before they escalate into 500 errors.

Good luck, and feel free to ask questions! 🙂

Join the Discussion
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!

Savvy WordPress Development official logo