WordPress: Embedding YouTube and Vimeo Videos
YouTube and Vimeo videos can easily be embedded into Pages and Posts using a ‘shortcode.’ This code contains information within square brackets ([ ]) that WordPress converts to an accessible video player.
Follow these steps:
- In the WordPress editor, place your cursor where you wish the video to appear.
- Begin the shortcode by typing an opening square bracket: [
- Add the shortcode name: hmc-video
- Obtain the video ID from the video platform.
- YouTube video IDs are 11 alphanumeric characters e.g. DF7Bj1QRdsg.
- Vimeo video IDs are 9 numbers e.g. 192417650
- Add the video ID number like this example: id=”DF7Bj1QRdsg”
- Add a title for the video. Use the title as it is displayed on the video website. e.g. title=”Harvey Mudd College is on a Mission”
- Close the shortcode: ]
The final shortcode for the Harvey Mudd College mission video would therefore look like this:
[hmc-video id="DF7Bj1QRdsg" title="Harvey Mudd College is on a Mission"]
And when you save the Page or Post and view it, will be displayed thus: