Archived topic
Lazy loading youtube video without plugin
3 replies · Started by Shrawan on May 29, 2021
Hello GP team,
Could you please tell me how I may Lazy load Youtube embeds with Generatepress? I don't wish to use a plugin, so by using Code Snippets, is it possible to unlock this feature?
I notice that pages with Youtube embeds don't pass the CoreWebVitals test, and my research tells me that lazy loading Youtube videos is one way to walk-around this problem. Your guidance would be valuable. Thanks!
Hi there,
The YouTube embeds feature is handled by WordPress so it's unrelated to the theme.
I'd say that the plugin solution is the way to go. Otherwise you'd need to look for a custom function that works for WordPress.
Keep in mind that code is code - it doesn't matter if it's added using a plugin or custom function, it is still code.
Hi @Leo is there a plugin you guys would recommend for this purpose? Thanks!
Unfortunately we don't have a recommendation for this.
I don't imagine that there are too many options out there for this so give a couple of them a shot and see which one works for you the best :)