Change WordPress theme from database with phpMyAdmin

You can easily change current theme modifying WP database. Login to your phpMyAdmin and open wp_options table. Search for template and stylesheet values in option_name column then simple rename corresponding option_value to a theme that you want to activate. Note that the theme have to be uploaded to wp_content/themes catalog.

So if in my themes folder I would place theme called Divi and Divi-child i would rename above fields as in example below:

The theme catalog name is the theme name you want to paste in to the template value field. If I would not use child theme I would rename both value to “Divi”.

Change WordPress theme using SQL

You can also change those values using SQL. In my scenario I would run:

UPDATE `wp_options` SET option_value = "Divi"  WHERE `option_name` = "template";
UPDATE `wp_options` SET option_value = "Divi-child"  WHERE `option_name` = "stylesheet";

If you want to use default twentytwentyone WordPress theme you would run:

UPDATE `wp_options` SET option_value = "twentytwentyone"  WHERE `option_name` = "template";
UPDATE `wp_options` SET option_value = "twentytwentyone"  WHERE `option_name` = "stylesheet";
0
Would love your thoughts, please comment.x
()
x