How do you Defer Parsing of JavaScript for YouTube video on a WordPress site?

后端 未结 3 2466
轮回少年
轮回少年 2021-02-19 18:43

I just today realized that of my 1.2 MB site (per GTMetrix), 550k of it is a YouTube video.

My web site is a WordPress site, and the current video loads in an iframe.

3条回答
  •  忘掉有多难
    2021-02-19 19:21

    The best and faster thing to do is to replace the video iframe by something like a link or an image, and load the iframe on click or another event.

    Ahmed Essam linked you a solution, but if you don't want or don't know how to edit files on your wordpress installation, the Embed Video Thumbnail plugin does the job:

    https://wordpress.org/plugins/embed-video-thumbnail/

提交回复
热议问题