Documentation will be updated after Scripts Organizer version 3 is released.

YouTube Shortcode with lazy load video and scripts on click

screenshot 2021 10 11 at 12.49.15

Current problem is if you embed youtube in WordPress it's going to load a bunch of scripts that will dramatically increase a load time.

With this approach scripts and video will be loaded only after user clicks on video thumbnail.

Shortcode usage

To use shortcode wrap "yt" and "id=yourid" in backets []

group 4

You don't need to wrap ID in quotes.

Get YouTube ID

In YouTube Bellow video click share. After you get a popup copy only the code after:

share id

Code Block Settings

Trigger Location: Conditions
Script Location: PHP and Header > CSS

screenshot 2021 10 11 at 12.49.15 1

This content is visible only for owners of

Scripts Organizer.

Please login to see the content.

Marko Krstić

Owner of dPlugins. Started with design in 1999. Currently, besides dPlugins, he is an Art director at Scandic Hotels, delivering design for the Web and the App for 270 Scandinavian hotels.