Updating wordpress theme from database

Posted on February 3, 2017 by Suresh Kamrushi in PHP

Here I am sharing, how you can update theme from database.
Step 1: Go to database and browse the “wp_options” table and try to locate “template” and “stylesheet” in “option_name” fields. You can also run below query:

 SELECT * FROM wp_options WHERE option_name IN ("template","stylesheet")

see the screen shot below:

wordpress Theme databse

wordpress Theme databse

Step 2: In result you can observe the theme name is mention against each “option_name”, you need to update those values with “twentyseventeen”, “twentysixteen” or “twentyfifteen” to change the theme. Now from where you will get this theme names?

Step 3: Now got to folder “wp-content\themes” to see the list of themes available. It will look like below:

wordpress Theme folder structure

wordpress Theme folder structure

Step 4: Copy the folder name and update the “option_value” for “template” and “stylesheet”. Make sure both values should be same.
Now if you go the site theme will be updated according to new values.

WordPress version: 4.0.17

  Comments or questions are welcome  

Tagged as