With the arrival of Core web vitals everyone is rushing to get the colors changed from red to green. 🙂
One of the reason your pages & posts might be getting a poor speed score is due to Youtube Video Embeds which loads up external libraries in order for the video player to run.
We have put together a code that will lazyload all the youtube videos on a page or post without the need of any external plugin or library. All you need to do is put the below code in your theme’s functions.php