
Automating Pre-Roll Video Ads in WordPress with Elementor Video Widgets
I wanted a way to add pre-roll ads to Elementor videos without turning each page into a custom embed project. The main problem was not video playback itself, it was configuration drift. Once ads live in separate shortcodes, extra players, or theme code, editors lose track of what controls the final experience. So I built a plugin that extends the existing Elementor Video widget instead of replacing it. Inside the widget, I add a dedicated Video Ads section where an editor can enable a pre-roll clip, define skip timing, and optionally attach a visit link. That keeps the ad logic attached to the same content object as the main video, which makes updates much less error-prone. Under the hood, the plugin works in two layers. The first layer is widget-level configuration stored with Elementor data, so each video can have its own ad behavior. The second layer is a WordPress admin settings screen for global rules, where I can define a default ad and control where it applies or where it should
Continue reading on Dev.to Webdev
Opens in a new tab




