This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

[Black Friday Savings] Unleash the power of managed cloud hosting at 40% OFF for 4 months. GET THE DEAL

How to Fix the 500 Internal Server Error in WordPress

Updated on August 16, 2022

9 Min Read
WordPress 500 Internal Server Error

You may have encountered the infamous 500 internal server error on your WordPress site and going berserk trying to get rid of the error notice. But don’t worry! The easy fixes mentioned in this detailed guide will help you knock the error away in minutes.

Every website on the internet is vulnerable to errors, and so is your WordPress site. The errors may range from bugs in your themes and plugins or due to WordPress hosting issues. While some errors can be fixed with minor tweaks, others may take plenty of your time and would even require external help.

Among the common WordPress errors, the 500 internal server error may appear out of nowhere, limiting access to your website. This blog lists the common causes and fixes to help get acquainted with the error and its solution.

What Is the WordPress 500 Internal Server Error?

The WordPress 500 internal error is an application-side issue and mostly occurs on the server level. Mostly it is caused due to plugin/theme issues, corrupted .htaccess file, database, caching issues, hosting issues, or due to a PHP memory limit.

When you visit a specific URL, the server takes your request to show you the page. In the case of an internal server error, the server fails to show you the page resulting in an error message.

example of 500 internal server error

– Example of Internal Server Error

What Causes the 500 Internal Server Error in WordPress?

The 500 internal server error can appear on any site, not just WordPress sites. Mostly it is caused due to plugin or theme issues, but it may also occur due to exhausted PHP memory limit, corrupted files, or coding issues.

The root of this error is on the server side, so the fix also lies there.

Are You Tired of Fixing WordPress Errors?

Try Cloudways managed hosting for a hassle-free experience. And with our SafeUpdates feature, automate the regular maintenance of WordPress sites.

How to Fix the 500 Internal Server Error on Your WordPress Site

Since the 500 internal server error on WordPress occurs for various reasons, it has multiple fixes. I recommended following the fixes listed below chronologically to fix the error quickly.

Backup Your WordPress Site

First and foremost, create a backup of your WordPress site. You don’t want to lose anything, so better be safe.

Even if you have implemented extensive security precautions, like using a secure WordPress hosting service or regularly updating WordPress core and plugins, your website data could still be compromised.

Even an innocent coding error can bring down your site. That’s why backing up your WordPress site is critical. You can do it manually or by using the trusted WordPress backup plugins.

Refresh Your Page

Sometimes, even reloading the page can knock the internal server error away, so why not try the simplest solution first?

A server can get overloaded and goes down for some time, and the issue is often fixed with a mere refresh. So, start with a page refresh in your quest to fix the 500 error.

Clear the Browser Cache

Another easy fix to the 500 internal server error is by clearing the cookies and cache. Sometimes, cache files may get corrupted, restricting your access to the site. This step can also help you in bypassing the 404 error and the White Screen of Death.

But before this, you should check if the site is down everywhere via websites like Is it Down Right Now. If it’s only down for you, then you may proceed to clear your browser cache. The method to clear cache & cookies is different for each browser. You can clear them by going to the settings.

If you’re a Chrome user, use the shortcut key combination of Ctrl+Shift+Delete, and proceed with clearing the cookies and cached images.

clear browser cache

Reload your page after clearance, and check if the problem persists. If yes, then move on to the next method.

Check Your .htaccess File

A .htaccess file is a key file in all PHP-based applications that controls your website’s configuration. If your .htaccess file is corrupted, it can lead to a 500 internal server error. This file is usually affected by a module or a broken theme installation.

You can fix the error in these cases by accessing the .htaccess file. Follow the steps below to access and fix the .htaccess file.

  • If you are a Cloudways user, log in to the Cloudways platform.
  • Click servers and select your server.
  • Copy your Master Credentials from Server Management, and paste them into the FTP client.

server master credentials

  • Click Quickconnect.
  • Click applications > public_html
  • You’ll see a file named .htaccess in the root directory.

.htacess File in WordPress Root Directory

  • Now that you have located your .htaccess file, you can download it from the live server to a local location on your PC.
  • Open this file in any text editor like Sublime Text 3, Notepad++, Dreamweaver, etc.
  • Go to .htaccess on WordPress.org
  • Copy and paste the version of the code that fits best for your website
  • Save the .htaccess file and upload it to your web server.

The code differs for different WordPress configurations and installations. If you have used WordPress Multisite in WordPress 3.5 or later, then you need to use the following code:

# BEGIN WordPress Multisite
# Using subfolder network type: https://wordpress.org/support/article/htaccess/#multisite
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

# END WordPress Multisite
  • Reload your site to see if the 500 Internal Server Error is fixed or not. If not, move to the next step.

Plugins Audit

Conduct regular plugin audits to ensure your website uses the most recent plugins.

Faulty or outdated plugins can cause compatibility issues, leading to errors in your WordPress website. Updating each plugin can be very tiring, so at Cloudways, we offer the SafeUpdates feature to automate the regular maintenance of WordPress sites.

Nevertheless, if you wish to perform the audit manually, you may follow the steps below:

  • Go to your WordPress dashboard.
  • Mark the plugins you want to deactivate.
  • Click on the drop-down menu, and click Deactivate.
  • Refresh your website.

Deactivate WordPress Plugins

You may deactivate your plugin one after another, refresh, check if the website is working again, and then activate that plugin. This whole process will help you identify the faulty plugin.

Once you’ve found the culprit, you can either remove it or replace it with an updated plugin. If you still get the error even after checking all your plugins, move on to the next step.

Theme Audit

Sometimes a WordPress theme can lead to a 500 internal server error, even if you are using the best WordPress themes. Follow the steps below to switch to the default WordPress theme:

  • Go to your WordPress dashboard.
  • Click Appearance > Themes.
  • Activate the Twenty Twenty-Two theme.
  • Your old theme will automatically be deactivated upon a new theme’s activation.

change your WordPress theme

You can change your theme via the FTP client if you can’t access your WordPress dashboard.

  • Log in to your FTP client.
  • Locate the folder named “theme.” (You may find it in wp-content).
  • Rename the “theme” folder.
  • Refresh your WordPress site to see if the error still persists.
  • If you don’t see the error, it’d mean that your theme caused it, so opt for a new theme.

rename the themes file in FTP

If you still see the error, try out the next solution.

Think You’re Paying Extra Hosting Costs?

Steer clear of what you pay for your hosting needs. The Web Hosting Savings Calculator helps you instantly find out the right cloud hosting solution based on your requirements.

Increase PHP Memory Limit

When PHP workers are already busy on a site, they start to build up a queue. Once you’ve reached your limit of PHP workers, the queue starts to push out older requests which could result in 500 errors or incomplete requests. Read our in-depth article about PHP workers.

Some of the most common ways of increasing a WordPress website’s PHP memory limit is by altering the code in any of the following files:

  1. Functions file
  2. .htaccess file
  3. WP-Config file
  4. PHP.ini file

Functions File

  • Go to your FTP client.
  • Go to your root directory, and locate the functions.php file.
  • Right-click the file and click Download.

edit the functions.php file

  • Open the functions.php file in your text editor.
  • Add the following code at the opening PHP tag:
@ini_set(‘upload_max_size’ , ’64M’);
@ini_set(‘post_max_size’, ’64M’);
@ini_set(‘max_execution_time’, ‘300’);

.htaccess File

  • Go to your FTP client.
  • Find the .htaccess file in your root directory.
  • Right-click on the “.htaccess” file and select Download.

edit the .htaccess file

  • Open the .htaccess file in your text editor and add the following code at the tag below PHP:
php_value upload_max_filesize 64M
php_value post_max_size 64M

WP-Config File

  • Log in to your FTP client.
  • Go to your root directory.
  • Find the wp-config.php file, right-click on it and select Download.

Edit the wp-config.php file

  • Open the wp-config.php file in your text editor and add the following code at the opening PHP tag:
define(‘WP_MEMORY_LIMIT’, ’64M’);
ini_set(‘post_max_size’, ’64M’);
ini_set(‘upload_max_filesize’, ’64M’);

PHP.ini File

  • Create a php.ini file in the wp-admin/ directory.

Create a php.ini file in wp-admin

  • Paste the following code.
memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
file_uploads = On

If you still see the 500 internal server error after trying out the above solutions, head over to the next method.

Contact Your Hosting Provider

Contact your hosting provider if the problem persists even after trying the abovementioned solutions. You can place a request to the technical experts who can resolve your issue by going over your server settings.

If you are a Cloudways user, then the process is quite easy-peasy. Contact our 24/7 support team, and get instant guidance on resolving any issues.

Fresh wp-admin and wp-includes

A typical WordPress website consists of third-party themes and plugins, and auditing its source code is not easy.

If none of the above solutions work, you can try this one as a last resort. But you must keep in mind that you’ll lose all your data. So, the best practice is to back up your website before this step.

You need to download new wp-admin and wp-content folders and upload them to the live host via FTP.

  • Head over to the WordPress.org website.
  • Click on Get WordPress.
  • Click “download and install.”

download and install WordPress

  • This will redirect you to downloading the latest WordPress version.
  • Click download to get the zip file.

download the WordPress zip file

  • Extract the .zip file.
  • Connect to your WordPress website via an FTP client.
  • Go to the root folder, and look for the wp-admin and wp-includes files.

Drop wp-admin and wp-content to FTP client window

  • Select the wp-admin and wp-content files from the extracted files, and drop them into the FTP client window.
  • Select overwrite, and also mark always use this action.
  • Click OK to continue.

select overwrite

Once the process finishes, all your older WordPress filers will be replaced by new ones. And if any of your WordPress files were causing the 500 internal server error, this process will fix the error.

Summary

After trying the fixes mentioned in this detailed guide, I hope you have gotten rid of the 500 internal server errors on your WordPress site. Which solution helped you in fixing the 500 error on your website? Let us know in the comments below.

Q. How do I fix a 500 Internal server error?

You can fix the 500 internal server error by trying out the following fixes:

  • Refresh your page
  • Clear the cookies & browser cache
  • Check your .htaccess File
  • Plugins and themes audit
  • Increase the PHP memory limit
  • Contact your hosting provider
  • Fresh wp-admin and wp-includes

Q. Can you fix an internal server error?

Yes, you can fix an internal server error by increasing your PHP memory limit, fixing a corrupted .htaccess file, deactivating faulty plugins & themes, clearing the cookies, or contacting your hosting provider.

Q. What is a 500 error?

A 500 error is an internal server error that typically appears when there’s a problem with the site’s server. It could arise due to scripting or configuration issues of your web hosting. It may also occur due to corrupted files or broken code.

Q. How do you fix 500 Internal server errors? There is a problem with the resource you are looking for, and it cannot be displayed.

The first solution to a 500 internal server error is to refresh the page. If the error persists, you may try clearing the cookies, deactivating faulty plugins or themes, fixing the .htaccess file, or contacting your hosting provider.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Customer Review at

“Beautifully optimized hosting for WordPress and Magento”

Arda Burak [Agency Owner]

Sarim Javaid

Sarim Javaid is a Digital Content Producer at Cloudways. He has a habit of penning down his random thoughts and giving words and meaning to the clutter of ideas colliding inside his mind. His obsession with Google and his curious mind add to his research-based writing. Other than that, he's a music and art admirer and an overly-excited person.

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Unleash The Cloud.
Not Budgets.

For 4 Months +
Up To 30 Free Migrations

Black Friday

SAVINGS
Time Left In Offer
  • 0

    Days

  • 0

    Hours

  • 0

    Minutes

  • 0

    Seconds

40% OFF

On All Plans

GET THE DEAL NOW
Nov 26, 2022 12:00:00