If YouTube in Redactor Then Wrap in Div So I have been using this CSS Tricks responsive video trick for years. The problem I'm having is that this new Craft site I built imported data over from EE into a single Redactor field.

Is there any way to run s conditional check that if there is a YouTube video embedded that would wrap a div around said content?

I'm probably asking too much but Craft has been amazing for the past few years I've using it. I fear the only way to do this would be to run an elaborate MYSQL commands to wrap that content in a div (or use JS to wrap each iframe) but I would love to be proven wrong!
Check out the Retcon plugin! 


  Retcon is a small Craft CMS plugin offering a series of easy-to-use Twig filters for manipulating HTML content.


Specifically, it sounds like you need the wrap method:

{{ entry.body|retconWrap('iframe', '.videoWrapper') }}