WordPress 500 Error

Today, I was testing new themes for this blog. Unfortunately, something went wrong and I was greeted by 'Error 500' and no further details. The error occurred on every page and made the website completely unusable. This article will summarise the steps I took to fix this error.

Make a back-up

Once you connect to the FTP server make sure you a back-up of your WordPress directory and the DATABASE, because this may go horrendously wrong!

Enable Debugging (Optional)

The first thing you need to do is to enable the debugging in WordPress. This will help you track down the error. This can only be done via FTP (or SFTP) and wp-config.php.

This is an adapted and slightly modified code from wordpress.org.

Download WP

I hope you remember which version of WordPress you had as far as I know it has to be down to X.X correct. Download, extract, copy over the FTP server and override ALL the files (but make sure you have a safe backup!!). The copy of the WordPress shouldn't override your wp-config.php.

Edit the database

Go to your database and find the table wp_options. Make sure you have backup your database first. Before making any changes make sure you have a backup.

In the table find option_name ='template' and option_name ='stylesheet' and change the theme to the default for that version (in my case it was twentysixteen).

If you have a MySQL here is the code:

It all worked. Now you can remove the debug code from wp-config.php.