Remove MediaElement JS & CSS

Any suggestions on completely removing all mediaelement js and css?

  • Alexander
    • DEV MAN’s Mascot

    Hi @buddha,

    Could you give a bit more context here? What exactly are you trying to accomplish here?

    This code should stop the WordPress video shortcode from adding the scripts/styles:

    add_action( 'wp_print_scripts', 'no_mediaelement_scripts', 100 );
    add_filter('wp_video_shortcode_library','no_mediaelement');

    function no_mediaelement_scripts() {
    wp_dequeue_script( 'wp-mediaelement' );
    wp_deregister_script( 'wp-mediaelement' );
    }

    function no_mediaelement() {
    return '';
    }

    Let me know how it goes!

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.