How to Change WordPress Theme From the Database Print

  • 1

 

When you want to change the look and feel of your WordPress site, you normally go into the WordPress Dashboard, head over to the Appearance and make the theme change. Really simple.

But what if your site isn't coming up? You get a blank screen, with no messages, sometimes called the 'White screen of death". Often, it is a new plugin or plugin update that is incompatible with your current theme.

Thinking it might be a plugin you renamed all your plugin directories, but that didn't work.... the site is still down.

Well it could be your theme files got messed up from a recent theme update or any number of other reasons, most likily a WordPress update itself.

Did WordPress push a new 'core' update? Maybe your theme is not compatible with that new WordPress version. If that's the case see if your theme author has a new update and follow the authors update instructions.

But what if All the Plugin directories have been renamed, you theme has no new update and your site is still a white screen.... there could be further issues, but we want to rule out if WordPress itself is the cause by manually changing the theme in the database.

Getting in to the database sounds scary, but following these simple directions, should allow you to come out unscathed.

 

Ready to start?

A few more words before we do start....

WordPress comes with default themes which we usually replace as one of the first things when setting up a website/blog with WordPress. These default themes are designed to work with the current version of WordPress and therefore give us a good idea as to if the theme itself is the problem you are getting white screen and no other errors.

If your theme is corrupted we can always get back a default WordPress theme that is installed with each WordPress installation. In case you deleted your default theme then you can upload it again or change your default theme to something else which is in theme’s folder of your Wordpess site.

Here is a list of some of WordPresses default themes (as of this writing)
- Twenty Sixteen [https://wordpress.org/themes/twentysixteen/]
- Twenty Seventeen [https://wordpress.org/themes/twentyseventeen/]

We will reference these in this article.

 

STEP 1: Getting information about the database

WordPress has all of the information about your database, it's name, user name (aka login), password and the important table prefix all in one convienant file in the root or base directory of the website, called "wp-config.php".

You can get to this file by two popular methods, FTP or through your Account Control Panel (Web Site Panel for Windows Hosting or cPanel for Linux hosting plans).


STEP 2: Getting in to phpMyAdmin

phpMyAdmin is the web interface to allow access to the database which WordPress uses and stores all information into for your website/blog. Most of the information in the database is stored in plain text format, so it's easy to read.

ACCESS to phpMyAdmin Windows Hosting

  1. Login to your account
  2. Click the green 'Control Panel' button
  3. Hover over the Database Icon, Click on "MySQL 5.x"
  4. To the right of the Database, Click "Browse Database"


ACCESS to phpMyAdmin Linux Hosting

  1. Login to your account
  2. Click the green 'Control Panel' button
  3. Scroll down to the 'Databases' Section, Click on "phpMyAdmin"

Once you have entered into phpMyAdmin area, you will have a list of databases on the left panel. Open the desired database we need to work on.

 

STEP 3: BACKUP

WARNING: working with the database directly is a permanent change. You will want to do a backup FIRST!

Since phpMyAdmin is now open, click on the database name you wish to work with.

At the top of the right side, will be a tab called 'Export', Click on that.

The options should be pre-selected for you and all you need to do is press the 'Go' button at the bottom.

This will save a copy of the database automatically on your personal computer with the file name extension of .sql

 

STEP 4: Working with wp-options, where the theme is stored

Click on the database name from the "wp-config.php" file, it most likely is the only database. This will expand and open to show the database tables. You are looking for the one called "<prefix>_options". (NOTE: before the underscore '_' there could be a name or set of characters, this is the 'prefix' for the table name, used to identify which table belongs to which database. In this case all the tables should have the same prefix.)

Clicking on the name or the '+' symbol will open the table and revel a list of 'rows' on the right side of the screen. The rows we are looking for are called 'template' and 'stylesheet'. They will usually be on page 2, you can get there by going to the bottom of the page and either using the drop down, select page 2 or use the greater than sign '>' to move to the next page.

You will want to click the word 'Edit' next to the row name 'template'.

In the large open box labeled "option_value", the current template name will be in there, you will want to overwrite this and change it to "twentyseventeen", then press 'Go' to write that information in to the database.

Now navigate back to find the row named 'stylesheet' and do the same, replace the stylesheet name with "twentyseventeen". And again press 'Go' to write that in to the database.

 

That's it!  If you go back to your browser and type in your domain, your site will be back online.  It will look very different because of the theme change, but the point of this was to determine if the theme was causing the issues with your website.  If your site came back, you'll want to get in contact with the theme developer or your web developer and let them know the steps you just went through and issues you have been having.

 

Also See: Website Features KB's Domain/DNS KB'sHOW TO KB'sEmail Settings POP3 / IMAP | Check email online | Email Troubleshooting | Adding an email to your hosting account WINDOWS / LINUX

Contact Support

If you are still having issues, please contact us for further help.
1-877-EPHOST1 | support@ephost.com

 

 


Was this answer helpful?

« Back