How to Change WordPress Theme From the Database?

Normally we manage our themes from WordPress’s dashboard (admin) area. It is plain and simple to switch, add or upload new themes from WP Dashboard.

Sometimes in an unavoidable situation like updates or changes in plugins/themes may interrupt the theme to work properly. It could be reason that the theme is not compatible with the changes and it gets you a blank screen.

Another situation may arise when a webmaster needs to change the theme. Simply, most of us would install a new theme and activate it through the dashboard. If it is not compatible for some reason you will get a blank screen or some sort of error.

This is the reason why I am here speaking of this issue and to let you know that there is another way to achieve the same purpose. This way you don’t even need to login and reach to your dashboard area.

The method is so easy and you are going to be do it in just couple of minutes! You don’t need to be technical guru of course!!


Getting started.

Ok. Just for records! Let’s discuss a little basic about default themes before we processed!

We all know that there is default WordPress theme with each WordPress blog.

For example: twentysixteen, if you recently setup your WordPress.

If our theme is corrupted we can always get back to our 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.

As you may already know, we have database connected with each WordPress website and that takes control of everything. Most of the textual content is saved in there except some media files. Also, each web hosting’s control panel mostly has phpMyAdmin area that let us interact with mysql databases. In order to change the theme from database, we need to have access to our phpMyAdmin area.

Let us see step by step guide how we can achieve the target.

Changing theme within phpMyAdmin

Step1: Know your database

Before you work on your database you need to know the name of your database. In fact, database names are not user friendly names and they have nothing to do with your website name.

If you do not know how to know the database name for your particular website you need to open wp-config.php either using file manager or using FTP access.


Once you open this simple file, you can meet all the database information of your website at one single place.

Step 2: Open the database

To have access to your database you need to login to your hosting’s control panel account using the given credential from your hosting provider. Currently we’re taking cPanel as an example since it is widely used by site owners.

After successfully login to your cPanel, go to the database section where you can see phpMyAdmin icon. You need to click on it in order to have access to your database.


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: Working with wp-options

Once the particular database is opened, it will show you an array of tables. You need to click on wp-options.

Keep in mind, the table can have prefix different from wp_.

If you have clicked 1-click installer for more than one WordPress installation the prefix can be 0_. Or if you used your own prefix, you can find it accordingly but neverthless, you can see wp-options there.

Now, you will see rows such as template and stylesheet that is usually available you on the page 2.

You can also click on browse and then show to make all the rows appear to you on one page.

Step 4: Changing the theme

Click on option_value for template and then replace it with a default theme like twentyfourteen or twentyfifteen. Hit save to make the necessary changes to take effect.


You need to repeat the same for stylesheet.

If you have uploaded a new theme using FTP or any other medium and want to run then you need to just replace it with the theme name and so repeat to the stylesheet.


Here we are done with the changes without opening the dashboard or disturbing themes.

Now, you can go to the front page of the website and see if the theme has been changed successfully or not.