Title: Lazy loading video
Last modified: February 16, 2020

---

# Lazy loading video

 *  [abuki](https://wordpress.org/support/users/abuki/)
 * (@abuki)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/lazy-loading-video/)
 * Hello. lazy uploading pictures works great .. please tell me when will you add
   the lazy upload for youtube.com video? You have a great plugin, and for the lack
   of lazy video loading, I have to install other plugins for lazy loading ..!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flazy-loading-video%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/lazy-loading-video/#post-12443098)
 * not planned for the short term, waiting to see how “native lazy load” turns out(
   which will likely have support for iframes -so youtube- soon).
 *  Thread Starter [abuki](https://wordpress.org/support/users/abuki/)
 * (@abuki)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/lazy-loading-video/#post-12443387)
 * You don’t have a code that would let youtube videos load in lazy loading mode
   too? How can I do it ?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/lazy-loading-video/#post-12443971)
 * Well, assuming you have lazyload active in AO, you could try this one (it’s a
   bit rough around the edges, consider it a Proof of concept);
 *     ```
       add_filter('autoptimize_html_after_minify','lazyload_iframes');
       function lazyload_iframes($in) {
       	return str_replace( '<iframe', '<iframe class="lazyload"', $in );
       }
       ```
   
 * have fun! 😉
    frank
 *  Thread Starter [abuki](https://wordpress.org/support/users/abuki/)
 * (@abuki)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/lazy-loading-video/#post-12470962)
 * How to replace the src attribute with data-src in the img: tag in all pictures?
   
   Using function?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/lazy-loading-video/#post-12470985)
 * replacing the src for data-src in image tags is done automatically by Autoptimize
   when lazyload is active abuki 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Lazy loading video’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [lazy loading](https://wordpress.org/support/topic-tag/lazy-loading/)

 * 5 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/lazy-loading-video/#post-12470985)
 * Status: not resolved