How to change wordpress theme directly from database?

January 9, 2010 |  by Mukesh Chapagain

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';
Related Posts with Thumbnails

8 Comments


  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!

Trackbacks

  1. Design Gala
  2. josoroma
  3. moodleitandme

Leave a Reply