Embedding a YouTube video in WordPress
Putting a YouTube video in WordPress? That’s easy, isn’t it? You just copy the link into the post and click on publish.
Well, yes, that will put a video into your post. And it will look like the one below.
And here’s the video:
Literally all I have done here is viewed the video on YouTube and then copied and pasted that URL into the WordPress post. Great. Except that I want to use this video in the new Online Illumination site we are developing, so I would really like it to be a lot cleaner. I would like to get rid of some of the menu bars and definitely the preview of other videos that come on the end of my video automatically.
So, what to do?
Step 1: Remove the link to other videos
- View your video on YouTube
- Underneath your video click the “Share” button
- Then click the “Embed” button
- In the Embed options you will see “Show suggested videos when the video finishes” – make sure that is NOT ticked
- Copy the Embed code from the box and paste into your WordPress post. (Make sure you are on the HTML tab not the Visual tab)
- Publish and there you are – your video (or the one you want to link to) without reference to whatever YouTube thinks would be good at the end.
Step 2: Removing other menubars, links etc.
Now this isn’t quite so easy as it means fiddling with the embed code a bit. Basically you need to grab the embed code as detailed in step one. Then you can add other bits to it.
So here, if you look at the wording closely you can see the list of funny letters which is the reference to the video UNvQbNwckKo. Then I’ve added “?modestbranding=1” which reduces the mention of YouTube all over the screen. “rel=0” is the part that refers to not showing previews to other videos on the end of my one and finally “showinfo=0” takes off the menubar at the top of the video when it first appears on the screen.
You will see that each of these items are separated by an & and there are no spaces left between the commands.
If someone hovers over the video you can still link back to YouTube but it makes it all a bit cleaner and tidier to view. Well at least I think so anyway. So here’s the final version as it will appear in Online Illumination soon: