Title: Dequeue styles, scripts and some actions
Last modified: August 31, 2016

---

# Dequeue styles, scripts and some actions

 *  Resolved [heytricia](https://wordpress.org/support/users/tendigit/)
 * (@tendigit)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/dequeue-styles-scripts-and-some-actions/)
 * I use your plugin with my own styling and script. With the latest upgrades the
   option to use my own CSS is broken. Plus dequeued script is now included in the
   page code. I see a partial response to this in another thread, but I want to 
   disable css and scripts via my functions file as so:
 * wp_dequeue_script(‘hoverIntent’);
    wp_dequeue_script(‘megamenu’); wp_dequeue_style(‘
   megamenu’);
 * I would also like to disable the “flush cache” nags that come up after each update.
   We’re not using the plugin css, so I’m thinking we shouldn’t have to flush it.
 * What do I need to add to my functions file to make all of this work?
 * Thanks!
 * [https://wordpress.org/plugins/megamenu/](https://wordpress.org/plugins/megamenu/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [hooty940](https://wordpress.org/support/users/hooty940/)
 * (@hooty940)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/dequeue-styles-scripts-and-some-actions/#post-7175304)
 * Same issue here. Inline css for the plugin is being generated after the recent
   update, even when I have selected “Don’t output CSS” in the General Settings.
 * It’s a local site, so no link to the site is available. I’m running WP 4.4.2.
 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/dequeue-styles-scripts-and-some-actions/#post-7175306)
 * Hi Both,
 * I’ve just released 2.1.2 which includes a fix for “Don’t Output CSS”, please 
   try updating and let me know how it goes.
 * Tricia, I’ll get back to you tomorrow about dequeueing those scripts (it’s getting
   pretty late here and it’s been a long day). In the mean time you might be able
   to modify the code at the bottom of this page: [https://www.maxmegamenu.com/documentation/pro-features/google-fonts/](https://www.maxmegamenu.com/documentation/pro-features/google-fonts/)
 * The flush cache nag will be totally removed in a future release.
 * Regards,
    Tom
 *  Thread Starter [heytricia](https://wordpress.org/support/users/tendigit/)
 * (@tendigit)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/dequeue-styles-scripts-and-some-actions/#post-7175310)
 * The update did fix the CSS issue. Thanks much!
 * Get some brain-rest… looking forward to hearing back from you upon recovery. 
   😉
 * – T
 *  [hooty940](https://wordpress.org/support/users/hooty940/)
 * (@hooty940)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/dequeue-styles-scripts-and-some-actions/#post-7175413)
 * I can also confirm the recent update fixed the CSS issue. Thank you for your 
   quick response!
 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/dequeue-styles-scripts-and-some-actions/#post-7175433)
 * Hooty, thanks for the review – much appreciated! 🙂
 * Tricia, please can you try adding this to your themes functions.php file?
 *     ```
       function megamenu_dequeue_scripts() {
          wp_dequeue_script( 'megamenu' );
          wp_dequeue_script( 'hoverIntent' );
       }
       add_action( 'wp_enqueue_scripts', 'megamenu_dequeue_scripts', 9999 );
   
       function megamenu_dequeue_styles() {
          wp_dequeue_style( 'dashicons' );
       }
       add_action( 'megamenu_enqueue_public_scripts', 'megamenu_dequeue_styles', 9999 );
       ```
   
 * Note: if you’re logged in as an admin then dashicons will be automatically re-
   enqueued (for the icons on the admin bar)
 * Regards,
    Tom
 *  Thread Starter [heytricia](https://wordpress.org/support/users/tendigit/)
 * (@tendigit)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/dequeue-styles-scripts-and-some-actions/#post-7175446)
 * Worked perfectly. Thanks so much!
 * – Tricia
 *  Plugin Author [megamenu](https://wordpress.org/support/users/megamenu/)
 * (@megamenu)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/dequeue-styles-scripts-and-some-actions/#post-7175477)
 * You’re welcome & thanks for the review! 🙂
 * Regards,
    Tom

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Dequeue styles, scripts and some actions’ is closed to new replies.

 * ![](https://ps.w.org/megamenu/assets/icon-128x128.png?rev=1489843)
 * [Max Mega Menu](https://wordpress.org/plugins/megamenu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/megamenu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/megamenu/)
 * [Active Topics](https://wordpress.org/support/plugin/megamenu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/megamenu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/megamenu/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [megamenu](https://wordpress.org/support/users/megamenu/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/dequeue-styles-scripts-and-some-actions/#post-7175477)
 * Status: resolved