8 Ways to Fix HTTP 500 Error in WordPress

If you're hitting a wall with the HTTP 500 Error on your WordPress site, this article is for you. We break down easy-to-follow fixes to help you get rid of the error in minutes.
Published: January 18, 2024
Technical Writer
AI Tools For WordPress Creators
Code, learn, troubleshoot, and secure WordPress sites with the CodeWP platform and our custom AI.
Start for Free

Struggling with the dreaded HTTP 500 error on your WordPress site and not sure what to do?

First off, don’t panic - at least, not yet!

This error is more common than you think, but it can be a bit tricky to fix, especially if you're new to website troubleshooting. It might appear out of nowhere, and there’s no one-size-fits-all fix. Some fixes are quick and easy, others might need a bit more effort.

But as Sun Tzu said, “Know thy enemy.” In the same way, you need to understand the root cause of the error. Once you do, it becomes easier to tackle.

We’re here to help! Follow along as we discuss the common causes of the HTTP 500 error in WordPress. We’ll also share eight ways to fix them. By the end, you should get your site back up and running again!

What is an HTTP 500 Error in WordPress?

The HTTP 500 error is like a server’s way of saying that something went wrong, but it can’t provide a specific reason. And this can happen to any website, not just on WordPress. 

Depending on the server and browser you’re using, the HTTP 500 error might look something like this:

WordPress Internal Server Error

However, this type of error comes in several variations. Each might display a slightly different message, but they all essentially point to the same underlying issue. These variations include:

  • 500 Internal Server Error
  • HTTP 500
  • Error 500
  • HTTPS 500 error
  • Temporary Error (500)
  • HTTPS error 500
  • HTTP Error 500 – Internal Server Error
  • The website cannot display the page – HTTP 500

How to Fix the HTTP 500 Error in WordPress

While the exact cause of the HTTP 500 error in WordPress isn’t always clear, there are ways you can troubleshoot it. 

We’ve prepared a list of potential solutions below to help you out. We advise you to work through each one until, hopefully, you can find the right fix.

Note: It’s always a good practice to back up your website before troubleshooting or changing anything. This will keep all your content safe if things don’t go as expected!

1) Refresh Your Page

If the issue is caused by a minor glitch with the server, then refreshing your page browser should fix the error. On your keyboard, simply press F5. Or, click the refresh button on your browser.

2) Clear Your Browser and WordPress Cache

Sometimes, the HTTP 500 error could be caused by your browser or WordPress storing outdated or corrupt data. To resolve this, simply clear your browser’s or WordPress’s cache.

On WordPress, you can use a caching plugin like LiteSpeed Cache to do the job. Look for the option to clear the cache within its settings.

As for your browser, go to the settings or history section to clear the cache. If you’re using Chrome, simply click on the three little dots on the browser. Then, go to Settings > Privacy and Security, and click on ‘Clear Browser Data.’ Check the ‘Cached images and files’ option and click ‘Clear data.’

clear browsing cache

If you need more details, be sure to check out our separate tutorial on How to Clear WordPress Cache.

3) Deactivate Plugins

If the basic methods above don’t work, then the issue could be one (or a combination) of your plugins. This usually happens if a plugin is malfunctioning or outdated. Compatibility issues are also common, particularly after WordPress or other plugins have been updated. 

To isolate the problem, you'll need to deactivate your plugins. Here’s how it’s done via FTP:

  • Connect to your website using an FTP client.
  • Navigate to the 'wp-content' folder.
  • Look for the 'plugins' folder and rename it, like 'plugins_old.'
rename plugin folder
  • Check if the error is resolved.

If this fixes the error, it's likely a faulty plugin or a conflict between plugins. The next step is to find the specific problem:

  • Rename the folder back to 'plugins'.
  • Now, in the WordPress dashboard, go to Plugins > Installed Plugins and  activate each plugin one by one.
activate plugins on WordPress
  • Check your website after each activation.

If the error reappears, then you’ve found the culprit! What you should do next is to update or replace the faulty plugin. You can also reach out to the plugin developer for support. Developers are often aware of these issues and may already have a solution in place.

4) Deactivate Your Current Theme

Just like plugins, themes can sometimes cause issues if they’re not working nicely with the other plugins, or if they’re not compatible with the latest WordPress updates.

If you suspect your current theme might be causing the error, you can try deactivating it and switching to a default theme. 

Follow these steps if you’re using FTP:

  • Connect to your site via FTP.
  • Go to the '/wp-content/themes/' directory.
  • Find your current theme's folder and rename it. Doing so will deactivate the theme and switch it to a default theme, like Twenty Twenty-One.
rename theme folder
  • Refresh your website and see if the error is gone.

If this resolves the issue, the original theme might have compatibility issues or bugs, so consider replacing it with a different theme.

But if this doesn’t solve the issue, move on to the next step.

5) Reupload the Core Files

In the previous steps, we talked about how problematic plugins or themes can lead to an HTTP 500 error. 

Suppose you've already audited them, but the issue persists. In that case, your next step is to re-upload new wp-admin and wp-includes folders.

Here’s how to do it:

  • Download the latest version of WordPress from the official website.
  • Unzip the file on your computer.
  • Connect to your website using FTP.
  • Look for the wp-admin and wp-includes folders on your root directory.
  • Replace these folders with the new ones from your downloaded WordPress file.
replace WordPress core files

Note: Using this method could result in losing all your data. So, it's really important to back up everything before you proceed with the changes - it’s always better to be safe than sorry!

6) Check the ‘.htaccess’ File

The ‘.htaccess’ file is an important core file in WordPress. It controls various configurations of your web server, including creating URL redirects, adding password protection, loading customized error pages, and adding caching rules.

If the ‘.htaccess’ file is corrupted, it can trigger an HTTP 500 error. This usually happens when there’s a conflict with other directives in the server configuration, or it contains syntax errors from manual edits to the file. 

To fix this, you need to get WordPress to update the ‘.htaccess’ file. You can do so by heading over to Settings > Permalinks in your WordPress dashboard. No need to change any settings -  just scroll down to the bottom of the page and click ‘Save Changes.’

WordPress permalink

Refresh your page and see if this has resolved the error.

If not, then you’ll need to replace the ‘.htaccess’ file manually. Here’s how to do it:

  • Connect to your site via FTP, or log in to your cpanel and go to File Manager.
  • Look for the ‘.htaccess’ file in the root directory.
  • Rename the file (like ‘.htaccess_old’) to keep a backup, and then create a new one.
  • Go to the htaccess documentation in WordPress. Here, you’ll find different versions of htaccess codes. Copy the one that best fits your website. For instance, if you choose Basic WP, you can copy the following codes:
# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
  • Open the new ‘.htaccess’ file you’ve created on a text editor, and paste the code here.   
  • Save the changes and upload the file to your server.

That’s it! Now, check your website again and see if the error is gone.

7) Change PHP version

If your PHP version is outdated, it might conflict with the current settings on your server. Older PHP versions might also not support the latest WordPress features which leads to compatibility issues and the dreaded HTTP 500 error.

You can easily change your PHP version on your control panel. Look for the software section and select the PHP version that fits your site. WordPress recommends PHP 7.4 or higher for optimal performance and security.

updating PHP version

If you're not sure which version to choose, we highly recommend you contact your hosting provider for advice.

8) Change the PHP Memory Limit

Another reason why you’re having an HTTP 500 error is that your website doesn't have enough PHP memory.

By default, WordPress sets the PHP memory limit to 32MB, which is usually enough for small websites. When you reach this limit, WordPress tries to increase this to 40MB.

But if that’s still not enough, you’ll get an error. 

To fix this, increase the memory limit in one of these files: the WP-Config file, the functions file, or the .htaccess file. You can find them in your site's root directory. Use an FTP client or go to your cpanel, pick the file you want to edit, and add the codes below.

For the ‘wp-config.php’ file, add these codes just above the line that says ‘/* That's all, stop editing! Happy publishing. */’:

define('WP_MEMORY_LIMIT', '64M');
ini_set('post_max_size', '64M');
ini_set('upload_max_filesize', '64M');

For the ‘functions.php’ file, add these codes at the end of the file:

@ini_set('upload_max_size' , '64M');
@ini_set('post_max_size', '64M');
@ini_set('max_execution_time', '300');

For the ‘.htaccess’ file, add these codes at the end of the file:

php_value upload_max_filesize 64M
php_value post_max_size 64M

Note: If you’re a beginner and not comfortable doing this yourself, contact your hosting provider for help.

What Causes the HTTP 500 Error?

As we’ve mentioned, the exact cause of the HTTP 500 error is not always clear. You can think of it as a generic response when the server encounters an issue that prevents it from completing a request.

This issue could be due to:

  • Corrupted core files
  • A faulty plugin or theme
  • Conflicts with WordPress updates
  • Exhausted PHP memory limit
  • Outdated PHP version

Unfortunately, identifying the root cause of this error is often challenging, especially if you’re new to managing a website.

You’ll need a systematic approach to get to the bottom of this error. Make sure to follow the steps we've outlined above to rule out each potential source of the problem.

Tips to Prevent Future HTTP 500 Errors in WordPress

Internal server errors can be frustrating both for you and your visitors. But is there a way to prevent it from ever happening?

Yes, but it requires a clear understanding of how WordPress works, and then taking proactive steps to prevent it.

Here are some of the things you can do:

  • Check your WordPress memory limit, especially if your website is growing. You can check this on your hosting account or the ‘wp-config.php’ file. You can also use a WordPress plugin like WP Health Check.
WordPress memory limit
WordPress Site Health Page
  • Use a WordPress staging site when testing new plugins or modifying codes. This way, you can play around and fix bugs without risking your live site.
  • Turn on WordPress debug logs to catch errors early. Simply add the following codes to your ‘wo-config.php’ file:
define( 'WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true);
  • Always have a full backup of your site - we can’t stress this enough. Remember, backups might save your site one day if something goes wrong.

HTTP 500 Error WordPress - FAQs

Why is my website showing HTTP error 500?

Your website is showing an HTTP error 500 because something's gone wrong on the server, like a glitch with a plugin, theme, or server file. It's like a generic alert that the server can't handle the request as expected.

How do I fix error 500 on WordPress?

To fix the HTTP 500 error in WordPress, you can try several methods. These include checking the '.htaccess' file for errors, increasing the PHP memory limit, turning off plugins and themes to find conflicts, and making sure the WordPress core files aren't corrupted.

How do I fix 500 internal server error in Chrome?

To fix a 500 Internal Server Error in Chrome, start by refreshing the webpage, as the issue might be temporary. If the error persists, try clearing your browser's cache and cookies.

That’s It!

As we wrap up, remember that if you've tried all the solutions and the HTTP 500 Error persists, then here’s your final resort. 

First, contact your hosting provider, as they have the tools and expertise to diagnose server-level issues that might be out of your reach. 

Another option is to reinstall WordPress. This can help refresh your system and eliminate any deep-rooted issues. 

Lastly, if you have a recent backup of your site, consider restoring it to get things back to normal. However, be aware this might mean losing the recent changes or customizations. 

We hope these tips prove useful in resolving your issue. Good luck!

About The Author
Christy Cañete
Technical Writer
More By Christy Cañete
Christy is a front-end developer and technical writer with expertise in JavaScript, React, Node.js and other web technologies. As a writer for CodeWP, she breaks down complex AI and WordPress concepts into easy-to-understand tutorials so anyone can leverage the platform's advanced capabilities. Christy's experience spanning web development, IoT, and embedded systems enables her to clearly explain technical topics to empower WordPress creators of all levels. Her passion is making the latest innovations accessible through beginner-friendly writing.
HTTP 500 Error WordPress

More Reading

Make WordPress Easy With AI
© WPAI, Inc. 2024 | d.b.a CodeWP