Modify Youtube Oembed URLs

Expanded from here.

There are different methods for modifying Youtube’s iframe url to get the look and feel you want for your embedded youtube video. WordPress offers Oembed functionality which makes it easy for WordPress users to input youtube urls into metaboxes, content, etc. What is not as straight forward is altering the appearance that WordPress’s Oembed outputs. Changing WordPress’s Oembed iframe URL parameters can be quite cumbersome for some. It’s important to be able to remove and modify some of the default settings of the youtube iframes. Ie: the titles using youtube api’s showinfo attribute. With oembeds, you can’t simply change the output of the iframe URL by pasting in the showinfo and rel attributes at the end of your WordPress content or metabox’s URL slug.

To make these changes, you can add this code snippet to your functions.php file or a plugin:

 

 

Revisions

Tags: , ,

No comments yet.

Leave a Reply