5

Any idea on how I can totally disable or entirely remove the default/Native Wordpress video player?

1
  • 1
    Note that if you do this it'll revert to the default player the browser provides, which will appear very different from browser to browser. This may also break playlists
    – Tom J Nowell
    Jan 20, 2021 at 21:39

3 Answers 3

7

welcome aboard.

WordPress uses Media Elements JS for default video/audio player. You can disable this scripts with this code. Please add this code to your theme's functions.php

 function deregister_media_elements(){
   wp_deregister_script('wp-mediaelement');
   wp_deregister_style('wp-mediaelement');
}
add_action('wp_enqueue_scripts','deregister_media_elements');

PS. This code de-register mediaelements.js from all WordPress (with your current theme).

0

I just tested this method, by using this piece of code you will eliminate watching online option from users. The file will be automatically downloaded as somebody enters the page.

0

Serkan's answer removed only some mediaelement files for me. This removed it completely:

    function deregister_media_elements(){
       wp_deregister_script('mediaelement');
       wp_deregister_style('mediaelement');
    }
    add_action('wp_enqueue_scripts','deregister_media_elements');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.