function change_theme_manually() { global $wpdb; $newtheme = 'twentyeleven'; $wpdb->update($wpdb->options, array('template'=> $newtheme), array('stylesheet'=> $newtheme), array('current_theme' => $newtheme) ); } add_action('init','change_theme_manually'); can someone tell me what is wrong with this? Doesn't seem to update the options