How to change wordpress theme directly from database?

Pin It


I had some error in my new wp theme. When I enabled the new theme, I got a blank page. I was unable to access my wordpress blog both from frontend and backend (admin panel).

In this case, either I need to change/fix my theme’s code. But, what if I am not a coder?

The solution is to change the currently active theme from database.

Open phpMyAdmin, go to your wp database. Open wp_options table. Search for three option_nametemplate, stylesheet, and current_theme.

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

See the option_value fields from the search result. The option_value will be your theme name. Change option_value of the search result to ‘classic’ OR ‘default’. Classic and default are the default wordpress themes present at the time of wp installation.

UPDATE wp_options SET option_value = 'default' WHERE option_name = 'template';
 
UPDATE wp_options SET option_value = 'default' WHERE option_name = 'stylesheet';
 
UPDATE wp_options SET option_value = 'default' WHERE option_name = 'current_theme';

12 total comments on this postSubmit yours
  1. Genial fill someone in on and this fill someone in on helped me alot in my college assignement. Thank you seeking your information.

  2. Thanks, helped me a lot!

  3. Thanks this help me today.

  4. ur information is more useful to me but 80 % i reach to success but remaining 20% creating problem can u sort out me frm this. i m not able to change d theme

  5. Thanks a bunch, got the white page myself today after changing themes & this definitely helped me out.

  6. THANKS A WHOLE LOT!!! iT HAD FREACKED ME OUT!!! Figured it out and I am a COMPLETE newbie on pHp…but please refine the steps a bit for them to be clearer…like what tab to click…what to put where…like replacing the theme name to “classic” etc…I followed it but am sure a whole lot of other people will be stuck..trust me!
    Thanks again!

  7. Thank you very much for this info!

  8. Thanks man, you saved my site!

  9. Since WP 3.0, you have to set ‘twentyten’ instead of ‘default’ or ‘classic’. Otherwise this doesn’t work.

  10. Thanks for the post…was able to reverse the damage I did today with this :)

  11. Thanks man. This worked for me. I wasn’t sure if that was all the DB entries that needed to be changed, so after doing what you suggested, I activated a different theme to update the DB, then activated my theme again. Awesome. Thanks for sharing.

  12. wow! very nice tips
    thanks to share with us man ;)

5 total pingbacks on this post
Submit your comment

Please enter your name

Your name is required

Please enter a valid email address

An email address is required

Please enter your message

Twitter

  • May 2, 2012 04:15

    10 Free WordPress Theme To Make You Forget About Premium Theme http://t.co/YRiLCiVa

  • March 2, 2012 17:16

    3 Helpful Tools to Test Cross Browser Compatibility of Webpage http://t.co/FY0jh8Dn

  • March 2, 2012 16:43

    3 Helpful Tools to Test Cross Browser Compatibility of Webpage http://t.co/QUlYKInf #IE #FF #Chrome #Testing #CrossBrowser

  • March 2, 2012 12:52

    Top 5 Plugins to Build Contact Form for WordPress http://t.co/PWyR08Iq #WordPress #Plugins #ContactForm

  • June 11, 2011 02:49

    CSS 3 Transitions http://bit.ly/m0pK3t

Design Gala © 2012 All Rights Reserved

Designed by 76miles

Powered by WordPress

More in WordPress (40 of 48 articles)