I have a plugin I want to use, but it depends on the $ identifier, as apposed to using jQuery.

Is it possible to enable the $, to save me recoding the plugin?


The plugin automatically adds the javascript, therefore I can't wrap it.

  • Honestly, I'd suggest using a different plugin, then. Or at least forking that plugin and rewriting the javascript to actually work with WordPress. May 6, 2011 at 15:08
  • Also, if you could add a link to the plugin, we could maybe give you advice on the easiest way to hack the plugin to work correctly. May 6, 2011 at 15:09
  • Is there not just a way to use $ in wordpress?
    – Mild Fuzz
    May 6, 2011 at 15:10
  • de-register jquery and then re-register your own copy without noConflict mode. You risk breaking a lot if you do that, though. May 6, 2011 at 15:52
  • 1
    As long as you kept the version of jQuery you're using identical to the one WordPress uses, you shouldn't have any problems. For example, using jQuery 1.5.x in WP 3.1 breaks almost everything in the admin area. May 9, 2011 at 13:16

3 Answers 3


Try this:

jQuery(function ($) {
    /* You can safely use $ in this code block to reference jQuery 
           Call your plugin here

I think you already know this. But still for reference http://api.jquery.com/jQuery.noConflict/

  • Also you can try var $ = jQuery; in the first line of the plugin. Sometime when i need to change all instance of $ to jQuery in a function. i just use it in the first line of the function and it works for me :) Thanks!
    – Sisir
    May 6, 2011 at 12:05

This should work, I believe:

var $ = jQuery.noConflict();
  • placed anywhere?
    – Mild Fuzz
    May 6, 2011 at 13:39
  • Placed above where you want to use $
    – Chris_O
    May 6, 2011 at 14:26

The code Sisir provided would work, or you can use this code:

    // you can use $ here

Your Answer

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

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