WebHostingPeople Blog

How Can We Help?

How to Change WordPress Theme by Editing Database?

You are here:

Normally we modify a WordPress theme from our WordPress dashboard. In some cases, updating a plugin just isn’t suitable with our current theme, so we have to exchange our WordPress theme. In such situations the sole way to modify the theme is manually from the database.


Steps to modify the WordPress theme inside phpMyAdmin

1) Sign in to cPanel.

2) Go to FileManager under ‘Data’ section.

Change Theme


3) Open ‘wp-config.php’ file and check the database identify.

Change Theme


4) Go to phpMyAdmin under ‘Databases’ and open the database for the WordPress website.

5) Open wp-options table from the database.

Change Wordpress Theme


6) Find and open two rows called the template and the stylesheet.

Change Theme


7) Open both template and the stylesheet. Then replace the current theme by adding the new theme in option_value.

Change Theme


8) Click on “Go” to enable modifications.


You can modify the WordPress theme by the terminal using the following steps.

1) Login to the server using SSH command.

2) Add the theme in the theme folder.

3) Login to MySQL using the below command.

# mysql -u root -p

4) Switch to website database

5) Check the current theme which is used in WordPress website using the following command.

SELECT * FROM wp_options WHERE option_name = ‘template’ OR option_name = ‘stylesheet’ OR option_name = ‘current_theme’;

6) Now update the WordPress theme using the below command.

UPDATE wp_options SET option_value = ‘Themename’ WHERE option_name = ‘template’;


If you need any further assistance please contact our support department.



Post Your Comment