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:

  1. In the WordPress editor, place your cursor where you wish the video to appear.
  2. Begin the shortcode by typing an opening square bracket: [
  3. Add the shortcode name: hmc-video
  4. 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
  5. Add the video ID number like this example: id=”DF7Bj1QRdsg”
  6. 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”
  7. 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: