How Do I Make a Video Autoplay in WordPress?

Making a video autoplay in WordPress is easy. Just add the following code to your theme’s functions.php file:

// Enable autoplay for videos add_action( ‘wp_enqueue_scripts’, ‘myvideo_enqueue_scripts’); function myvideo_enqueue_scripts() { wp_enqueue_script(‘myvideo’,’https://ajax.googleapis.com/ajax/libs/jquery/1.11.

0/jquery.min.js’); }.

Now all you have to do is add a video to your post or page, and it will automatically start playing when loaded. You can also control the playback from within WordPress by clicking on the video player icon in the post or page header, or by using the controls in the WordPress Media Library.