SKR Tips logo SKR TipsWebsite tips that actually work
Web Tips

How to Lazy Load YouTube Embeds on Game Guide Pages

A boss guide with six embedded YouTube clips feels helpful to write. Every phase gets its own video, readers can watch the dodge timing instead of reading about it, and the page looks complete.

A game guide web page with video thumbnails and play buttons shown on a laptop screen

A boss guide with six embedded YouTube clips feels helpful to write. Every phase gets its own video, readers can watch the dodge timing instead of reading about it, and the page looks complete. Then someone on a mid-range phone opens it over a patchy connection and waits. On our old clan wiki, a raid guide like that pulled in a little over 3.1 MB of YouTube scripts before the reader had scrolled past the intro, and most readers never pressed play on more than one clip.

The problem is not video itself. It is that the standard YouTube iframe loads the whole player, scripts, fonts and tracking code, for every embed on the page, the moment the page opens. If you run a gaming site full of guides, patch breakdowns and clip compilations, this is often the single largest weight on your heaviest pages, and fixing it takes an afternoon.

What one YouTube iframe actually costs

When I measured a plain embed on a test page, a single YouTube iframe triggered around 20 separate requests and roughly 1 MB of transferred data, most of it JavaScript. The exact figure moves around as YouTube changes its player, but it has stayed in that range for years. Six embeds do not cost six times as much, since some files get cached between them, yet they still added about 2 seconds of main thread work on a throttled phone profile.

That JavaScript has to be downloaded, parsed and run before the browser is fully free to respond to taps. On a guide page this shows up as a sticky feeling when readers try to open your table of contents or expand a spoiler box. It also drags down the Interaction to Next Paint figure in Search Console, which is the metric most fan sites I look at are quietly failing.

The fix is to show readers something that looks like the video, a thumbnail with a play button, and only load the real player when they click it. People who never watch pay nothing. People who do watch wait an extra half second, which they rarely notice because they asked for it.

Three ways to do it, from easiest to most control

Which one fits depends on how your site is built and how many embeds you already have. Here is how they compare on the sites I have set them up for.

MethodSetup timeWhat you getCatch
loading="lazy" on the iframe5 minutesPlayer loads only when near the screenEmbeds near the top still load right away
A WordPress plugin with click to load15 minutesThumbnail first, player on click, works on old postsOne more plugin to keep updated
A facade script such as lite-youtubeAbout an hourSmallest weight, full control of the markupYou edit each embed or write a filter

The native lazy attribute

Modern browsers support loading="lazy" on iframes. Add it to the embed code and the browser holds off on loading a video until the reader scrolls close to it. WordPress has added this attribute to embeds by default since version 5.7, so on a WordPress site it may already be there. Check by viewing the page source and searching for the iframe tag.

It helps on long guides where most videos sit far down the page. It does nothing for the clip you placed right under the title, and the browser starts loading slightly before the video scrolls into view, so fast scrollers still pay for most of them.

A plugin that swaps in thumbnails

For WordPress fan sites with years of old posts, a plugin is the practical choice because it rewrites existing embeds without you touching hundreds of articles. WP YouTube Lyte and the lazy load option in some caching plugins, including WP Rocket and Perfmatters, both replace the player with a preview image until someone clicks. Test one at a time. Running two of them together often produces a broken double thumbnail.

A facade script

If you build pages by hand, or run a static site generator for a wiki, a small web component such as lite-youtube gives you the lightest result. You load one small script and stylesheet, then write a short custom tag with the video ID in place of the iframe. The component draws the thumbnail and builds the real iframe on click. Google's Lighthouse report even suggests this pattern by name when it flags heavy third party embeds.

Lazy loading is not always the right call

The common advice says to lazy load every embed on the site. I disagree for one specific case: a page where the video is the content. A trailer reaction post, a clip of the week, or a speedrun record page where the run is the reason people came. There, a click to load placeholder adds a step for nearly every visitor, and the thumbnail is often the largest image on the page anyway, so your Largest Contentful Paint barely improves.

On those pages I leave the first video as a normal embed, sometimes with loading="eager" set on purpose, and lazy load anything below it. The rule I use is simple. If more than about half of readers will press play, load the player. If most of them came for the text and the video is backup, use a facade.

There is also a privacy angle that cuts the other way. A facade that pulls thumbnails straight from YouTube's image server still sends a request to Google when the page loads. If your cookie banner promises no third party requests before consent, host the thumbnails yourself or use the youtube-nocookie domain for the player, and check that the plugin you pick supports that.

Thumbnail details that are easy to get wrong

YouTube serves thumbnails at several sizes. The one most scripts grab by default, maxresdefault, does not exist for every video, and older uploads return a grey placeholder instead. hqdefault is always there at 480 by 360 pixels, which looks fine at guide page widths. If you pull your own thumbnails, convert them to WebP and give the image a width and height so the page does not jump when it loads. That jump is what Cumulative Layout Shift measures, and it is easy to make worse while fixing speed.

Give the placeholder a real label too. A play button with no text reads as an unlabeled button to a screen reader. Something like "Play video: Phase two dodge timing" costs nothing and also helps when the thumbnail fails to load. The same thinking applies to your screenshots, which I covered in the piece on alt text for game screenshots.

Checking that it worked

Open the guide in a private window, open the browser's developer tools, go to the Network tab and reload with the cache turned off. Type "youtube" in the filter box. Before the change you will see a long list of requests. After it you should see only thumbnail images, or nothing at all if you host them yourself. Click one placeholder and watch the player requests appear.

Then run the page through PageSpeed Insights on mobile. Expect total blocking time to fall noticeably on video-heavy guides, though I would not chase the score itself. As I wrote in why page speed scores mislead community admins, the field data in Search Console tells you more than one lab run. Give it 28 days, since that is the window the field data covers, and compare the guide pages before and after.

If you want one task for this week, pick your three heaviest guide pages, count the embeds on each, and switch them to click to load. That alone usually does more than shaving another 50 KB off your images, which is the next step covered in the guide to compressing images without blur.

FAQ

Does lazy loading YouTube embeds hurt SEO?

No. Search engines can still find the video through the link or the structured data, and faster pages tend to do better, not worse.

Will readers notice the delay when they click play?

Rarely. The player typically appears within half a second on a normal connection, and the reader has just chosen to watch.

Is loading="lazy" enough on its own?

For long guides with videos far down the page, it covers most of the gain. For embeds near the top, you still need a click to load facade.

Can I lazy load Twitch clips the same way?

Yes. The same facade idea works for Twitch and other players, though you will usually need to supply the thumbnail image yourself.

MO
Matthias Okeke

Matthias ran a clan website and a fan wiki for years before writing about them. He covers the sites gaming communities build, from guides to patch note pages.

More posts by Matthias

More in Web Tips

01doorganico 084goad 3hot8 4465456 after5internprogram ahandfulofblessings ahmadpc ahomcybersecurity allodialresources annodex antiquesandperiodcollectibles aotc asianworldkashmir beedlectrics bloggertemplatefree bluefeatheragency bodyweightsolution campaign08blog carfixadvisor catstreetcollective cbstvsports cnfanspurchasing committeeof500yearsofdignityandresistance covertopsdjs cs-kaiyuangame cuestacomunicaciontotal cxoutlet dancebetgame deskgearhub destinyvillastay detectmagazine di33 diamondsteelbuildings donmo dyanadropship emarsysfinance emimattl escapechan eskitarih evautoplay everythingweddings-orlando farmzone feedviewerapp foxstudiosscratch gamevui123 gleasongrade greetingsday hacklabasu haskell iw-kaiyun jagoanproperti jilidskripsi joltbusinessfinance juegodepokergratis juegospucca kaeru-festival latestmehndidesigns lestanzediottaviano litemagazines localcommunityhero lustrsazan mariashebets menswheels newwebstechs1 nikkit ootheday oxigenvpn plurfitness prefetial probudgetcarpetcleaning psychicmrsmartin pyaten qvantor rejoignezlogis rexzbot riselayouts ruchin rwxqsgd5 sakaltime shibiaowang shop-bot spotlesshaven strcoding tetapatrium topselller uneplanteartificielle vipertechcr webtech1223411 wo-kygaming yamaha-mekar yeknava yoybuysheets zenunwa yamaha-mekar jilidskripsi ankertoto ankertoto ankertoto ankertoto