YouTube

The YouTube shortcode for WordPress can be used to embed a video into a page or post. The shortcode comes with several settings like video width, autoplay, mute or alignment. Check below for example implementations and shortcode documentation:

YouTube Examples

YouTube Shortcodes

YouTube Shortcode
[x3m-youtube url="https://www.youtube.com/watch?v=ekr2nIex040" width="100%" autoplay="no" align="" mute="no"]
The shortcode can be used to embed a Youtube video inside your content by simply including the video link inside the code. The other settings can help you set autoplay or video sound to be on or off. Unfortunately Youtube settings do not permit to set the autoplay to active while the mute option is no. Above example displays a YouTube video from Daily Mood channel.

YouTube Documentation

Here are the shortcode option settings available for YouTube:

Shortcode Settings Details
url=”youtube link” This is used to set link of the Youtube video.
maxwidth=”100%” This is used to define the maximum width of the Youtube video container in percentage (ex “100%”).
autoplay=”yes” This is used to set video to start playing on page load or not. To automatically start playing, set the autoplay option to “yes”. The other option is “no”.
align=”center” This is used to set the video container alignment. For the cases when the video width is lower than that of the page, the video can be aligned “left”, “center” or “right”.
mute=”no” This is used to set video sound to be on or off. Options available: “yes” or “no”.

If autoplay=”yes”, the mute option should be set to “yes” as well, otherwise the video playback will not start automatically.