Hi @cosmoweb, you are welcome!
So, FDP doesn’t support partial scripts deregistering. For Freesoul Deactivate Plugins, a plugin is ON or OFF with all its scripts and stylesheets. In your case, it can’t help you. Maybe you need a plugin like Asset CleanUp.
If you want, they can also work together.
Where you don’t need the entire plugins you can use Freesoul Deactivate Plugins, where you want only to deregister scripts and stylesheets, you keep the plugins active and use Assets CleanUp.
Or, if it’s just for a few pages, a couple of lines of code in functions.php:
function my_dequeue_styles() {
global $post;
$id1 = 425;
$id2 = 675;
if( is_object( $post ) && in_array( $post->ID,array( $id1,$id2 ) ) ){
wp_dequeue_style( 'style-handle' );
wp_deregister_style( 'style-handle' );
}
}
add_action( 'wp_print_styles', 'my_dequeue_styles' );
function my_dequeue_scripts() {
global $post;
$id1 = 425;
$id2 = 675;
if( is_object( $post ) && in_array( $post->ID,array( $id1,$id2 ) ) ){
wp_dequeue_script( 'script-handle' );
wp_deregister_script( 'script-handle' );
}
}
add_action( 'wp_enqueue_scripts','my_dequeue_scripts' );
Where you should replace the values of $id1, $id2… with the pages IDs (in this example 425 and 675), and style-handle and script-handle with the names used by the plugin that enqueued that stylesheets and scripts.
I hope it helps.