It still displays the script because you are using the wrong hook (and it doesn’t exist) — wp_dequeue_scripts
, and secondly, if the script is indeed enqueued via wp_enqueue_script()
, then the generated id
(used in the <script>
tag) is in the form of <script handle>-js
(i.e. suffixed with a -js
) where <script handle>
is the first parameter for wp_enqueue_script()
.
Therefore in your case, the script handle is just jet-vue
without the -js
, and try dequeuing the script via the wp_print_scripts
hook instead.
function review_enqueue() {
if ( is_front_page() ) {
wp_dequeue_script( 'jet-vue' );
}
}
add_action( 'wp_print_scripts', 'review_enqueue' );
If that doesn’t work, you can try using a lower priority (i.e. a greater number) as the 3rd parameter for add_action()
. E.g.
add_action( 'wp_print_scripts', 'review_enqueue', 20 );
And if that still doesn’t work, then try contacting the plugin support and ask them for the proper way to dequeue their scripts. 🙂