Youtube embedded videos in WordPress not working

You’ll notice above that there is a youtube URL on the first line… it hasn’t embedded within the post.

UPDATE 2015-12-10: it’s working now, is it a WordPress 4.4 thing? I have disabled a LOT of plugins for the moment, I’ll come back and revisit this in the next couple of days. I have spent many hours working on this problem over the last few months and having just found I’ve had other issues, I’ll revisit this again

Embed the URL without embed tags
Embed the URL without embed tags

Also, I have just learned today that the youtube style of embedding without embed tags have been extended in WordPress 4.4 to include URLs to your own WordPress site (and possibly others).

Are you finding your http://youtu.be/{videocode} youtube links not embedding correctly or working in WordPress?

The correct format for the link is any one of the following:

http://youtu.be/{videocode}
http://youtube.com/watch?v={videocode}
[ embed]http://youtu.be/{videocode}[/embed ]

(there is a space before the embed in the above one to have it display correctly)

There are three things to watch out for to ensure this works. And if you do each of these, then you don’t need to use the [ embed ] code you see in the third example above. They are:

  1. Ensure the URL is on it’s own line
  2. Ensure you use HTTP in lieu of HTTPS (*1)
  3. Ensure the link does NOT appear on the first DISPLAYED line of the content

*1 : this is not a big one, since it seems most of the time it works, but for some reason it didn’t when I used it on this particular occasion.

I say DISPLAYED because in an effort to fix this, I tried putting a blank line for the first line. The problem persisted. It also didn’t help to include just a full-stop (period) there either.

I do believe it could also be theme related as this theme does not use the different post type options that is present in the newer themes. And from what I did find elsewhere, selecting different options in that meta-box can alter this behaviour. I will probably be changing themes in the coming months as I work further on my own custom theme, but for the time being if I want it to appear on the first line, I will use the appropriate [ embed ] code above (with the space removed!). This was not a problem I found documented anywhere else, so hopefully you have found this useful!

2 ways to trim youtube videos

I found a page that detailed a way to trim a youtube video. Which incidentally reminded me about tubechop. I read over the page that showed me another way to do it. I liked it because it uses the actual youtube video and inserts start and end tags (the end tag didn’t seem to work for me), where-as tubechop actually takes a copy of the youtube video and hosts it on it’s own servers. And frankly, I know nothing about these people and how long they intend to be around. So if you use it, then one day it just might not be there anymore. I have included both methods for you here anyway.

1) watch the instruction video directly from tubechop:

2) And here is the URL hack for the youtube link (I have highlighted the relevant section):

untrimmed
<object width=”425″ height=”344″><param name=”movie” value=”http://www.youtube.com/v/iGpIT2bVZDw&hl=en&fs=1&rel=0″></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”http://www.youtube.com/v/iGpIT2bVZDw&hl=en&fs=1&rel=0″ type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”425″ height=”344″></embed></object>

trimmed
<object width=”425″ height=”344″><param name=”movie” value=”http://www.youtube.com/v/iGpIT2bVZDw&start=204&end=228&hl=en&fs=1&rel=0″></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”http://www.youtube.com/v/iGpIT2bVZDw&start=204&end=228&hl=en&fs=1&rel=0″ type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”425″ height=”344″></embed></object>

This is the above example, note the big gap from the original start position to the new start position:


(featured on http://q-ontech.blogspot.com/2008/12/how-to-trim-youtube-video.html )

The same video edited in tubechop:

Speeding

I wouldn’t normally put this here, but I loved this li’l wideo. Maybe I’ll be posting some more….

Her: Honey, there’s a lot of juice in this car, you can’t handle the juice in this car
Him: There’s a lot of tickets in that trunk, and you can’t handle the tickets!
That’s GOLD!