After struggling with YouTube embed code for months, a friend just told me that I can have the YouTube URL on its own line and Wordpress itself creates the proper embed. Awesome! What else can I embed?
That’s a great question because the oEmbed feature (as WordPress folk call it) is something that’s continually being expanded and few of us ever hear about it. If you’re a WordPress blogger as I am, that’s a drag because it means that you’re either struggling to get it to work — as you have been with the YouTube embed code — or skipping the link entirely.
But just as WP is smart enough to not just add a YouTube player for a URL you specify but to also size it to be the optimal fit for your design, so can it handle quite a variety of other content too. It’s magic!
There’s an exhaustive list on the wordpress.org codex, so I’m going to just highlight a few.
The first and best to know if you produce or share video content is that if you simply cut and paste a YouTube URL into your blog post, a player appears.
Here’s an example. I’ll put a YouTube URL — https://www.youtube.com/watch?v=DHLFRZzxArk — on its own line and here’s what WP does:
Spiffy, eh? I generally chop down the URL to its shortest possible form, removing the &list=… material, but you don’t have to do so.
Another really neat oEmbed feature is that you can link to a Meetup.com page on its own line and a whole lotta stuff happens. Like this:
But wait, there’s more!
If you’re a Twitter user, link to a specific tweet (hint: copy the timestamp link) and this occurs:
— Dave Taylor (@DaveTaylor) May 29, 2014
Super cool, isn’t it?
Again, check out the list in the WordPress Codex of supported oEmbed URLs. There are more on their way too.
I will note that the Instagram oEmbed implementation is broken on my site, which is why I removed it from this article. Your experience will hopefully vary!