wp_is_mobile dequeue not working


According to this topic: Dequeue Scripts and Style for Mobile not working?

I used the last answer but for Slider revolution plugin and it does not work:

This is my function in functions.php:

add_action( 'wp_enqueue_scripts', 'remove_plugin_scripts', PHP_INT_MAX );

function remove_plugin_scripts() {
    if ( wp_is_mobile() ) {

    // Remove script file.
    wp_dequeue_script( 'rbtools.min.js' );
    wp_deregister_script( 'rbtools.min.js' );

    wp_dequeue_script( 'rs6.min.js' );
    wp_deregister_script( 'rs6.min.js' );

I just want to disable this two js files: rbtools.min.js and rs6.min.js from mobile loading for better rank in lighthouse.

this two js files loads from this file:

Rasam Server 2 years 2020-12-26T03:10:41-05:00 0 Answers 4 views 0

Leave an answer