Far too often people jump on the WordPress Plugin bandwagon instead of relying on the functionality built into the WordPress core. If you are trying to setup Podcasting or a video gallery that’s one thing but customizing the size of the video or turning off recommended videos after playback can be done quickly without the use of a plugin.
One reason a lot of people go to plugins first is that they just don’t know all the cool functionality hidden in the WordPress core – for example, I bet you didn’t know that WordPress has a built in Email Spambot Shortcode that only needs a small piece of code added to your theme to activate.
The benefit of doing it the WordPreess way is that more plugins mean more load time and lower SEO scores because once you get in the habit of relying on add-ins it becomes all too easy to bog down your site. This is especially true when it comes to something as simple as inserting a YouTube video in a blog post or page.
The first step to embed a YouTube video in WordPress is to get the correct link
Once you have selected the YouTube video you want to insert into a WordPress Page or Post go to the share link below the video author’s Subscribe link, then copy the URL (See red arrow).
Do not use the browser address link (red X) has slightly different code, it will work but I prefer the link without the “watch?v=” in the URL – just because.
Copy the URL, don’t click the embed – the URL is all you need.
Next, Embed Your YouTube Media
- In the page/post editor go to Add Media above the editor menu
- Select “Insert FDrom URL” in the left column
- Paste your copied URL into the box with the highlighted http://
- Click “Insert Into Post”
Finally, make adjustments to your embedded YouTube video
Unfortunately, YouTube no longer seems to honor the no suggested video option (?rel=0) that used to prevent related videos from displaying in YouTube after your embedded video completed playing. That creates an irritating conundrum because in some cases the YouTube suggested videos are completely unrelated, inappropriate for your target market or belong to a competitor. So for the sake of this tutorial, we will be adding an exception to our no plugin rule (until such time as youTube allows the option to work again) and suggest you install and activate “Hide YouTube Related Videos” – a simple plugin that doesn’t change anything else covered in this tutorial but does prevent the suggested videos from displaying.
Adjusting the Size of your embedded YouTube video in the WordPress Embed is actually pretty simple. all you need to do is add a height and or width to the embed shortcode in the “Text” tab of the editor. By default, these embedded YouTube videos are mobile responsive and resize proportionally (Google – aspect ratio) so you are actually setting a max height or width and the video may not resize exactly the way you want. It’s best to either set the width or the height depending on your aesthetic needs.