The response to our Better YouTube Embeds plugin has been tremendous. Lots of blogs have made their YouTube videos mobile compatible just by installing a simple plugin.
We’ve recently made some improvements to the plugin, and I wanted to take some time to address these.
Clearing Cache by Default
When the plugin is first activated, it will clear WordPress’s oembed cache for all previously published posts. This will ensure that all posts will receive the iframe embed code, not just new posts.
This is not an option you need to select, or a page you need to visit, it just works out of the box.
Using WordPress’s own Embed Functionality
With the large number of YouTube shortcode plugins out there, it seems many people don’t know about one of the coolest features of WordPress.
Since WordPress 2.9, you can embed any YouTube video just by pasting the URL into its own line in the post editor. Alternatively, you can use the WordPress shortcode
This will embed the YouTube video in your post, no plugins necessary for that part.
Better YouTube Embeds hooks into this functionality and simply tells WordPress to grab the iframe code, instead of the old Flash
object code. This way, WordPress still handles all of the caching, and you don’t need to change any of your code.
If you ever decide to stop using the Better YouTube Embeds plugin, all of your embeds will continue to work, you’ll just go back to the Flash embed code instead of the iframe embed code.
This makes it a much nicer choice than using special video embed shortcodes, which just stop working if the plugin disappears.