I've looked at this post https://stackoverflow.com/questions/9578013/how-to-unset-a-js-file-from-a-drupal6-installation-doesn%C2%B4t-work-with-remove-sc and this one How can I remove Javascript files?

and I've tried to duplicated it, but it wont work. I am trying to unset the regular jquery version. I've added this inside my phptemplate_preprocess_page function:

$js = drupal_add_js();
  $vars['scripts'] = $js;

when I print out $vars, it looks like it worked, but the original jquery is still included!

2 Answers 2


I can think of 4 things to check in this case, in order of likelihood:

  1. What does the preprocess function stub look like? Are you using the variable &$vars there, too, or are you using &$variables instead (which is how it appears in the documentation)? They, of course, have to match.

  2. Have you cleared your cache? D6 was bad about sometimes needing the cache to be cleared twice.

  3. Is the function actually running? If not, then there may be a problem with the function name that it is not being recognized, or that the cache has not been cleared (which should be taken care of by checking #2).

  4. Is something messing with the variable afterwards that is inadvertently re-adding the core js file?

  • 1- $vars is the correct variable 2- I did clear the cache multiple times 3- function is running, I was able do do a var dump from inside of it 4 - maybe, but I have no idea how to find it if thats the issue Oct 6, 2014 at 17:03

I finally found out what my issue was. I was #4 from coreyp_1's answer above: in the process of finding a solution, I had tried installing the jquery multi module, which didn't do the trick. This module was overrideing my work. When I disabled it, my code now worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.