← Blog

Improve the WordPress Audio and Video Player with 4 lines of code

WordPress1 min read

WordPress styles the default audio and video elements, and frankly it’s not an improvement.

Below is the code to turn the audio player from this

The WordPress-styled audio player

into this

The browser’s default audio player

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

Add the code to your theme functions.php file.

Stuck on something like this?

I help businesses and agencies with WordPress, WooCommerce and JavaScript problems, from one-off fixes to ongoing support.