Exclude iframes from image optimization
-
Is there a filter I can use to exclude any and all content loaded within an iframe from being lazyloaded?
Having tested with lazyload enabled/disabled and other Autoptimize options enabled/disabled I see that lazyload causes issues with Instagram embeds and ad units.
I tried excluding iframes by using class names with an asterisk e.g. ‘adunit *’ to capture all elements within iframes but this did not work and nomatter how many classes I exclude there are still embedded content units that get lazyloaded (well, that don’t load).
Is there a way to exclude iframes or is there an option (maybe a hidden one) to automatically wrap noscript comments around iframes (even, will noscript work to prevent lazyloading of iframes)?
Secondly, if I wrap noscript comments around iframes will doing so be detrimental to the way those iframes load?
As a side note, ads are optimized by some ad networks. When networks say ‘optimized’ they usually mean lazyload. I wish networks would leave optimization to website owners but no matter how much I argue this point with various networks (looking at you Mediavine) the networks ignore the request.
Lee
- The topic ‘Exclude iframes from image optimization’ is closed to new replies.