The oEmbed feature of WordPress allows you to easily embed a YouTube video into a page without having to install a plugin.
YouTube Embed with URL
There are two ways to embed a YouTube video. The easiest option would be to copy and paste the YouTube URL into the page content area. If you are editing in visual mode, It is a good idea to select the “Paste as text” option before pasting the YouTube URL. This will remove any hidden formatted characters from the URL. Alternatively, you can switch to the “text” editor and paste the URL.
Once you have pasted the URL WordPress will show a preview of the video in the visual editor.
YouTube Embed with Shortcode
If you want to customize the width and height of the YouTube video or do not like the URL embed method, you can embed it with a shortcode.
[embed width="480" height="360"]http://www.youtube.com/watch?v=dQw4w9WgXcQ[/embed
]
However, If you choose to use the embed shortcode I would recommend you not to specify a width and height. This is to make sure that your YouTube video looks great on mobile devices.
[embed]http://www.youtube.com/watch?v=dQw4w9WgXcQ[/embed
]
Are you using the same method to embed a YouTube video on your website? Feel free to share your thoughts in the comments.
Leave a Reply