https://wordimpress.com/removing-styles-scripts-from-your-wordpress-parent-theme/
Using code: Here’s an excellent function from Ngoc Nguyen that will print out the script handles. You can insert this into a page template, create a page with that template, then visit that page and you’ll see the list output really nicely on the page. Just make sure you don’t use this on a live site:
function wpcustom_inspect_scripts_and_styles() {
global $wp_scripts;
global $wp_styles;
// Runs through the queue scripts
foreach( $wp_scripts->queue as $handle ) :
$scripts_list .= $handle . ' | ';
endforeach;
// Runs through the queue styles
foreach( $wp_styles->queue as $handle ) :
$styles_list .= $handle . ' | ';
endforeach;
printf('Scripts: %1$s Styles: %2$s',
$scripts_list,
$styles_list);
}
add_action( 'wp_print_scripts', 'wpcustom_inspect_scripts_and_styles' );
How Do I De-Enqueue the Scripts?
Now that you have the handles of the styles or scripts that you want to de-enqueue, you’ve got to actually de-enqueue them. Here’s a few methods for doing that.
Using Code
I prefer to use code to keep the plugins to a minimum. Fortunately, de-enqueuing scripts and styles in WordPress is very easy. Add this to your custom functionality plugin:
/**
* Dequeue the Parent Theme scripts.
*
* Hooked to the wp_print_scripts action, with a late priority (100),
* so that it is after the script was enqueued.
*/
function my_site_WI_dequeue_script() {
wp_dequeue_script( 'comment-reply' ); //If you're using disqus, etc.
wp_dequeue_script( 'jquery_ui' ); //jQuery UI, no thanks!
wp_dequeue_script( 'fancybox' ); //Nah, I use FooBox
wp_dequeue_script( 'wait_for_images' );
wp_dequeue_script( 'jquery_easing' );
wp_dequeue_script( 'swipe' );
wp_dequeue_script( 'waypoints' );
}
add_action( 'wp_print_scripts', 'my_site_WI_dequeue_script', 100 );
/**
* Dequeue the Parent Theme styles.
*
* Hooked to the wp_enqueue_scripts action, with a late priority (100),
* so that it runs after the parent style was enqueued.
*/
function give_dequeue_plugin_css() {
wp_dequeue_style('additional-parent-style');
wp_deregister_style('additional-parent-style');
}
add_action('wp_enqueue_scripts','give_dequeue_plugin_css', 100);