Remove all js from template I'm trying to remove all javascript for anonymous users but I've hit a roadblock. 

This is the php I'm using in template.php (phptemplate_preprocess_page function):

$js = drupal_add_js();
unset($js['core']);
unset($js['module']);
unset($js['setting']);

$vars['scripts'] = $js;

print_r($vars['scripts']); // prints what it should
print_r(drupal_add_js('header', $js));  // prints everything like nothing happened!
You can do it in function phptemplate_preprocess_page exists in template.php

The below is code to remove unwanted js

function phptemplate_preprocess_page(&amp;$vars) {

  $scripts = drupal_add_js();
  //PRINT THIS ARRAY AND UNSET THE UNWANTED ARRAY
  // unset($scripts['module']['sites/default/files/js/jquery-min.js']);
  unset($scripts['module']['YOUR_PATH_TO_JS']);
  $vars['scripts'] = drupal_get_js('header', $scripts);  

}