How to manually change your Wordpress theme

I was working on another blog tonight and for some reason the theme I was using had a problem with widgets.  Soon as I changed a setting in options, I’d get a PHP error which was pretty annoying.  I couldn’t get into the admin at all and figured out a simple way to update the theme manually to at least be able to get into the admin.

The theme being used is stored in the wp_options table in the database.   Simply run these MySQL scripts and your site will be set to using the default theme (it’s based on the theme folder name):

update wp_options set option_value = ‘default’ where option_name = ‘template’
update wp_options set option_value = ‘default’ where option_name =’stylesheet’

Hopefully that’ll save you some time ripping your hair out if you stumble on a theme that trashes your admin.

Related posts:

  1. How to Exclude Category Posts from your Wordpress Homepage
  2. How to post your Facebook status on your Wordpress blog
  3. How to Show Empty Categories in Wordpress 2.7
  4. How to show empty categories in Wordpress using the default category widget
  5. Welcome to my new site


2 Responses to “How to manually change your Wordpress theme”

  • Deepesh Joseph Says:

    Thanks for the tip. I actually found an easier way -

    update wp_options set option_value =’classic’ where option_value = ‘philna2′

    In my case, I was having php error with philna2 theme, and I had to replace it with classic. THe above sql will update all occurances of philna2 theme and it worked fine for me.

    Thanks,
    Deepesh

  • Carl Says:

    Nice tip.
    I just changed the value manually in mysql and it worked.

Leave a Reply