Title: Removing plugin css and js
Last modified: August 31, 2016

---

# Removing plugin css and js

 *  [Kermit524](https://wordpress.org/support/users/kermit524/)
 * (@kermit524)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/removing-plugin-css-and-js/)
 * Hi,
    Thank you for your plugin. We are now at optimizing our site, and part of
   the process is dequeuing all styles and scripts files and bulk them together 
   for better speed and less http requests. We are not able to dequeue the Simple
   Membership plugin assets. When using wordpress’ dequeue_styles() and dequeue_scripts()
   functions, it doesn’t affect them. Is there any other way to do remove them, 
   or at least relocating them on the footer? Thanks in advance for your advice
 * [https://wordpress.org/plugins/simple-membership/](https://wordpress.org/plugins/simple-membership/)

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

 *  Plugin Support [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/removing-plugin-css-and-js/#post-7458152)
 * Hi, what process are you currently implementing to dequeue the css and js files?
   Do you have a cache plugin installed?
 *  Thread Starter [Kermit524](https://wordpress.org/support/users/kermit524/)
 * (@kermit524)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/removing-plugin-css-and-js/#post-7458155)
 * Hi thanks for your replay,
    I am using wp_dequeue_script and wp_dequeue_style
   functions to remove the 2 css files and the 2 javascript files. In the source
   code, the files are referred like this:
 *     ```
       <link rel='stylesheet' id='swpm.common-css'  href='http://carrier/thewines/wp-content/plugins/simple-membership/css/swpm.common.css?ver=4.5.2' type='text/css' media='all' />
       <link rel='stylesheet' id='validationEngine.jquery-css'  href='http://carrier/thewines/wp-content/plugins/simple-membership/css/validationEngine.jquery.css?ver=4.5.2' type='text/css' media='all' />
       <script type='text/javascript' src='http://carrier/thewines/wp-content/plugins/simple-membership/js/jquery.validationEngine-en.js?ver=4.5.2'></script>
       <script type='text/javascript' src='http://carrier/thewines/wp-content/plugins/simple-membership/js/jquery.validationEngine.js?ver=4.5.2'></script>
       ```
   
 * Here’s what’s in my functions.php file:
 *     ```
       function remove_vendor_scripts () {
       wp_deregister_style( 'dashicons' );
   
       wp_dequeue_script( 'swpm.common-css' );
       wp_dequeue_script('validationEngine.jquery-css');
       }
   
       add_action('wp_enqueue_scripts', 'remove_vendor_scripts');
       ```
   
 * 1. The css files have handlers: swpm.common-css and validationEngine.jquery-css,
   so I am passing them as arguments for the wp_dequeue_styles() function, but this
   doesn’t affect the page.
    2. The javascript files don’t have handlers, so I am
   not sure which is the best way to refer to them for the wp_dequeue_scripts function.
 * Currently I don’t have any cache plugin installed.
 * Thanks again.
    Michal
 *  Plugin Support [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/removing-plugin-css-and-js/#post-7458176)
 * Thank you Michal for sharing the code and information. This will help the plugin
   developers to assess your issue further.
 * Regards
 *  Plugin Author [wp.insider](https://wordpress.org/support/users/wpinsider-1/)
 * (@wpinsider-1)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/removing-plugin-css-and-js/#post-7458182)
 * All of our front-end JS and CSS files are loaded using the following hook:
 * wp_enqueue_scripts
 * So you should be able to dequeue them. It is likely that your custom call is 
   happening at a wrong time of the site’s page load execution (meaning it is being
   ineffective at intercepting it).
 * You can inspect the following function of our plugin’s code to see how we are
   using enqueue to load those files.
 * File: classes/class.simple-wp-membership
    Function: common_library()
 * That function is executed using the WordPress’s wp_enqueue_scripts hook.
 *  Thread Starter [Kermit524](https://wordpress.org/support/users/kermit524/)
 * (@kermit524)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/removing-plugin-css-and-js/#post-7458190)
 * Thanks wp.insider! Yes, I just now managed to dequeue the js files so I can add
   them directly in my build. However for some reason the css files are not dequeued.
   I probably miss something. Here’s the piece of code out of the function.php file:
 *     ```
       function remove_membershop_calls() {
       	/* Remove Simple membership js and css */
       	wp_dequeue_script( 'jquery.validationEngine-en' );
       	wp_dequeue_script('jquery.validationEngine');
       	wp_dequeue_style( 'swpm.common-css' );
       	wp_dequeue_style('validationEngine.jquery-css');
       }
       add_action( 'wp_enqueue_scripts', 'remove_membershop_calls', 20 );
       ```
   
 * Any idea what am I doing wrong?
    Thanks again, and in advance.

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

The topic ‘Removing plugin css and js’ is closed to new replies.

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

## Tags

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

 * 5 replies
 * 3 participants
 * Last reply from: [Kermit524](https://wordpress.org/support/users/kermit524/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/removing-plugin-css-and-js/#post-7458190)
 * Status: not resolved