What's WP
Find Everything Related to WordPress - Best Tutoriasl on WordPress!
How to Change WordPress Theme Directly from Database

How to Change WordPress Theme Directly from Database

As for the change of a theme, most webmasters prefer to install a new theme and then replace the old one with it via WP admin. In fact, there is another way to achieve the same purpose without logging into the website backend, which is great for webmasters who are unable to access to the WP admin. This method is explained in the guide on how to change WordPress theme directly from database.

Change WordPress Theme from Database

We would like to have the theme changed within phpMyAdmin, which takes control of the MySQL database. Follow this step-by-step guide to change your theme with ease.

Step 1: Log into cPanel and target phpMyAdmin under Databases section. Click phpMyAdmin and access to the database setting page.

cpanel Databases phpMyAdmin

Step 2: Expand the list in the left sidebar and find out the database name of your website. Once clicking it, a list of tables is shown under the name of this database. By the way, if you have no recollection of the database name, go to Files > File Manager and find the answer from wp-config.php file. To avoid such embarrassing situation, we suggest you to change your database name to an easy-to-remember one.

Step 3: Click the wp_options table. The detailed information of this table is shown on the phpMyAdmin interface.

Database WP_Options

Step 4: An array of tabs is shown on the top menu bar. First of all, click the Browse tab, which displays all options available for your website. Seek out two options from the options list, including “template” and “stylesheet”, which handle the template and stylesheet of your website. In most cases, the ID for the two options should be around 40.

Template and Stylesheet

Step 5: Target the “template” option and “Edit” it in the Insert tab. The current theme name is shown in the option_value mode. Replace it to the theme name that will be activated on your website. For example, we have installed multiple themes on the website, among which “Annotum Base” will be activated on the site. Type annotum-base in the option_value mode and click “Go” button to confirm the changes.

Edit Current Theme

Step 6: Open “stylesheet” option in the same way and replace the current theme name to annotum-base as well. Click “Go” button to confirm all changes.

Edit Stylesheet Option

The option_value for “template” and “stylesheet” should be the theme name you’ve typed just now.

Option Value of New Theme

Step 7: Go to your website front-end and check if the theme has been changed successfully. Modify certain settings for your website and make each web page match with this new theme properly.

Matters Need Attention

Before replacing the active theme to a new one, make sure that you have installed the new theme on your website. That can be completed via cPanel. Search for the target theme from WordPress.org and download it on your computer. Extract the zip file and go to cPanel > Files File Manager. Upload this file to public_html/wp-content/themes. That’s it!


Lucy has been a very experienced SEOer, technical writer, web developer, c# developer since 2002. Now she owns a startup in San Francisco, CA, focusing on running a couple of blogs to share knowledge and experience with global readers and deliver exceptional results to global sponsors by leveraging the power of Internet.