Adding YouTube Support to the WP Featherlight Plugin

Post written by Hudson Atwell
On Wednesday, June 2nd, 2021

I’m a big fan of the WordPress plugin WP Featherlight.

WP Featherlight looks through post content and finds images that link to themselves and turn their links into lightbox-ready images, which helps visitors magnify the image with the click of a button.

Want to see it in action? Here, we have it installed on this site. Click the image below:

We noticed that the Featherlight framework that WP Featherlight Plugin uses has iframe/YouTube support, but we couldn’t figure out how to make the official WP Featherlight plugin tell our images to launch YouTube videos when visitors clicked images.

We ended up forking the original WP Featherlight plugin and we made a few modifications to support this needed case scenario.

Here, try clicking on Cameron Frye at the Museum again below.

Pretty cool right?!

To get this effect all I had to do was tell Gutenberg to link the image to the YouTube video and the modded plugin took care of the rest.

You can find the original WP Featherlight plugin here on Github and also here on the WordPress plugins directory.

For the modified version, please head to the git repository below:

Some future improvements would be to extend support to Vimeo and other popular video players. It might also be well to support HTML-powered content.

There’s a lot of room to explore! And who knows, maybe the original developers will see this post and bake support into the original plugin.


Get help with difficult WordPress projects provides over 500 senior WordPress Experts that can help you get past dead ends.

About the Author:
Cheers! Hudson Atwell is a co-founder and current administrator of Inbound Now. Consider hiring him through the Agency or connecting with him professionally through LinkedIn.

Signup and get started with Inbound Now

Sign Up for Free


[gravityform id="3" name="Popup Form" title="false" description="false" ajax="true"]