Title: Dequeue scripts on pages not using player
Last modified: February 29, 2020

---

# Dequeue scripts on pages not using player

 *  [colinfroggatt](https://wordpress.org/support/users/colinfroggatt/)
 * (@colinfroggatt)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/dequeue-scripts-on-pages-not-using-player/)
 * Hi. I am trying to remove the mb audioplayer assets from pages that don’t use
   it to improve page performance. I am trying to using “Asset Cleanup” plugin to
   do that but it breaks the page with JS Console errors.
 * The page link added to this Q is for a page that is broken, then rest of the 
   site loads all MBA assets as normal.
 * When I stop the mba assets loading on a page, this causes JS errors and my sticky
   header/search box stops working.
 * The assets I stop loading are:
 *     ```
       map_overwrite_default_me /wp-content/plugins/wp-miniaudioplayer/js/map_overwrite_default_me.js  
       mb.miniAudioPlayer /wp-content/plugins/wp-miniaudioplayer/js/jquery.mb.miniAudioPlayer.min.js  
       mb.miniAudioPlayer.css  /wp-content/plugins/wp-miniaudioplayer/css/miniplayer.css
       ```
   
 * This causes the following Console errors in Firefox:
 *     ```
       ReferenceError: replaceDefault is not defined harp-making:730:32
           <anonymous> https://dev.handsonharps.com/harp-making/:730
   
       TypeError: jQuery(...).not(...).not(...).mb_miniPlayer is not a function harp-making:722:102
           initializeMiniAudioPlayer https://dev.handsonharps.com/harp-making/:722
           <anonymous> https://dev.handsonharps.com/harp-making/:732
           i https://dev.handsonharps.com/wp-content/cache/asset-cleanup/js/logged-in/head-f1b076388454c99e737f8a0910e7ed0362068d07-1.js:3
           fireWith https://dev.handsonharps.com/wp-content/cache/asset-cleanup/js/logged-in/head-f1b076388454c99e737f8a0910e7ed0362068d07-1.js:3
           ready https://dev.handsonharps.com/wp-content/cache/asset-cleanup/js/logged-in/head-f1b076388454c99e737f8a0910e7ed0362068d07-1.js:3
           J https://dev.handsonharps.com/wp-content/cache/asset-cleanup/js/logged-in/head-f1b076388454c99e737f8a0910e7ed0362068d07-1.js:3
       ```
   
 * I have tried to dequeue the assets using the following in child theme functions.
   php but seems not to do anything.
 *     ```
       add_action('wp_print_scripts', function () {
       	wp_dequeue_script( 'map_overwrite_default_me ' );
       	wp_dequeue_script( 'mb.miniAudioPlayer' );
       });
   
       add_action( 'wp_enqueue_scripts', 'xxxxxx', 99 );  
       function xxxxxx() { 
       	wp_dequeue_script( 'map_overwrite_default_me ' );
       	wp_dequeue_script( 'mb.miniAudioPlayer' );
       }
       ```
   
 * I have unloaded several other plugins such as the Revolution Slider on home page
   without a hitch.
 * Any help with this much appreciated.
 * P.S. I did make a donation when I started using this plugin a year or so ago 
   as I was so impressed with it 🙂
 * -Colin
 * WP 5.3.2
    MBA 1.9.3 Asset Cleanup : 1.3.5.7 Total Theme: 4.9.6
    -  This topic was modified 6 years, 2 months ago by [colinfroggatt](https://wordpress.org/support/users/colinfroggatt/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdequeue-scripts-on-pages-not-using-player%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘Dequeue scripts on pages not using player’ is closed to new replies.

 * ![](https://ps.w.org/wp-miniaudioplayer/assets/icon.svg?rev=983692)
 * [mb.miniAudioPlayer - an HTML5 audio player for your mp3 files](https://wordpress.org/plugins/wp-miniaudioplayer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-miniaudioplayer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-miniaudioplayer/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-miniaudioplayer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-miniaudioplayer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-miniaudioplayer/reviews/)

## Tags

 * [dequeue](https://wordpress.org/support/topic-tag/dequeue/)
 * [performance](https://wordpress.org/support/topic-tag/performance/)

 * 0 replies
 * 1 participant
 * Last reply from: [colinfroggatt](https://wordpress.org/support/users/colinfroggatt/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/dequeue-scripts-on-pages-not-using-player/)
 * Status: not resolved