Support » Plugin: Events Manager » [Plugin: Events Manager] How to disable scripts?

  • Resolved Ricardo


    I’m running EM 5.0rc1 over WP 3.3.

    By default, Events Manager loads all these scripts:


    and an extra inline JS code. I’m not using any of these scripts, at least not in the frontend, so I’d like to disable them in order to make the pages load faster.

    I already tried wp_dequeue_script unsuccessfully. Is there any other way to prevent all these scripts from loading?



Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Marcus


    wp_dequeue_script should work. Make sure you call it using the right action, e.g. init

    My bad, it does work. I was only dequeuing the script, I had to also deregister it. Here’s the code, in case anyone else needs it:

    function disable_scripts () {
    	if ( !is_front_page() ) {

    Hooking it to wp_enqueue_scripts instead of init allows to use conditional tags like the one in the example.



    Is there anyway to disable the following dependencies without disabling events-manager.js. Below dependencies are loaded in all pages. I think the below files are needed only in events calendar page. On all other pages we don’t need the below dependencies. Only events-manager.js will suffice.

    I saw below statement in events-manager.php but I dont want to modify this in core plugins files.
    wp_enqueue_script(‘events-manager’, plugins_url(‘includes/js/events-manager.js’,__FILE__), array(‘jquery’, ‘jquery-ui-core’,’jquery-ui-widget’,’jquery-ui-position’,’jquery-ui-sortable’,’jquery-ui-datepicker’,’jquery-ui-autocomplete’));

    Can you please help me?

    Thank you,

    Plugin Author Marcus


    not adviseable but possible, you’d have to remove the script e.g.


    and then re-enqueue it with a code similar what you pasted, but you need to check what page you’re loading so if it’s needed you do load these scripts (e.g. search page, bookings, submit events pages)

    I’ve tried to implement the final result of what these posts suggest but ‘events-manager’ wont’ load:

    add_action('wp_enqueue_scripts', 'child_enqueue_js', 20);
    function child_enqueue_js() { 
    	$eventsScripts = array(
    	wp_dequeue_script( $eventsScripts );
    	wp_deregister_script( $eventsScripts );
    	wp_enqueue_script('events-manager', plugins_url('includes/js/events-manager.js', 'events-manager'), 'jquery');

    The above code successfully removed the dependencies from being loaded, but it didn’t bring the events-manager.js back.

    Plugin Author Marcus


    Since EM depends on those scripts, it won’t load if you deregister them.

    I’ve been using “Use Google Libraries” – and it may be of interest to you as instead of loading seperate files it loads one jquery ui library with all the dependencies, and from the Google CDN.

    Thanks for the reply Marcus.

    To help you understand, the KenBurns Plugin I’m using already enqueued the following:

    So I’m trying to remove redundant scripts as this seems to be causing conflicts.

    I’m going to try de-registering the events manager script altogether and reregistering it.

    Plugin Author Marcus


    The problem with that is you’re enqueuing a version WP isn’t using yet. Whilst our JS should work with later versions of jQuery UI, I’ve seen situations where plugins load the jquery-ui script ALONG with the ones loaded by WP, causing even more problems.

    I’ve suggested this to someone today, try the plugin above and see if it resets all the jQuery inclusions so it includes one jQuery library, once, and from the Google CDN

    Thanks Marcus, this plugin you suggested did the trick:

    Use Google Libraries

    Plugin Author Marcus


    didn’t work for everyone, glad it did for you 😉

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Events Manager] How to disable scripts?’ is closed to new replies.