More speed, less tracking with Embed Privacy

Should I use YouTube, VideoPress or local hosting with WordPress? Can Embed Privacy reduce data use and improve privacy? Let's find out!

3rd party video hosting data usage and privacy

Concerns around embedding videos from third-party video hosting providers, include:

  • Unnecessary data consumption: external video player scripts and styling is loaded whether the visitor chooses to play the video or not.
  • Privacy and tracking: “free” video hosting providers like YouTube track your visitors, whether they consent or not.

There are several methods to address these concerns, including:

  • Host your videos yourself; utilize the native WordPress video block to display them.
  • Enable a plugin like Embed Privacy and get visitors’ consent before loading 3rd-party scripts.

In this article, I’ll use YouTube as an example as YouTube is a common source of videos, and it’s easier than writing “your thirdparty video hosting provider”. The solution, demonstrated, applies to any embed imaginable.

How does Embed Privacy help?

Normally, when you embed a YouTube video, WordPress loads their external player script immediately on page load. Embed Privacy ensures that no communication takes place with YouTube, until the visitor clicks an overlay with information regarding the privacy policy.

Not autoloading player scripts reduced network traffic 85%

In my tests, a blog post with just a YouTube embed results in 1500 KB of data transmitted, 7 tracking scripts and 2 cookies set. That is, before I click play.

With Embed Privacy enabled, data transfer initially reduced to just 234 KB, no tracking scripts or cookies. The player isn’t loaded until I actually hit play. That is a noticeable reduction in data transferred and definitely improves loading times, especially on slower connections.

Traffic with Embed Privacy compared to local hosting

Using three different WordPress blocks for embedding a video, I measured the data transferred …

  1. with Embed Privacy (EP) enabled, before clicking play.
  2. when the player script is loaded.
  3. total once the playback is done.
WordPress BlockWith EPPlayer loadedPlayback done
YouTube234 KB1500 KB20.8 MB
VideoPress152 KB2000 KB24.0 MB
Video (self hosted)120 KB120 KB13.7 MB
Page size with Embed Privacy, initially, with player loaded and playback done

Notice the 120 KB player loaded measurement for the native Video (self-hosted) block? That’s not an error. Since the WordPress video block simply renders an HTML video element, no additional player script is needed.

The energy costs of serving videos are affected by compression settings, video types, and data centre locations. It is not the goal of this comparison to conclude if one video hosting service is better than the other, but rather to demonstrate the data transfer savings and privacy implications.

The YouTube video embed block with overlay

To embed a YouTube video, you click the ⮫ Share button in YouTube, copy the given URL and paste it into the block editor. The block editor identifies the URL as a YouTube video, and insets a YouTube embed block.

That would normally show the video thumbnail and the red YouTube play button on it. With Embed Privacy enabled, a placeholder image (poster), and an overlay with a link to YouTube’s privacy policy is shown.

It’s easier to understand if I just show you:

Click here to display content from YouTube.
Learn more in YouTube’s privacy policy.

YouTube version of “Using theme.json with classic themes”

Now, the visitor has the option to read and consent to YouTube’s privacy policy, before any data is sent to or from YouTube. It adds an extra click, true. But that consent, you’d have to get otherwise, say, in a cookie pop-up.

VideoPress video embed block with overlay

To embed a video from Learn.WordPress.org, click the share button in the upper-right corner of the video. Paste the URL into the block editor, and a VideoPress block is inserted.

Some videos on Learn.WordPress.org are served by VideoPress.com. Below is the VideoPress version of the same video shown earlier. It’s worth mentioning, that the VideoPress version offers proper captions.

Click here to display content from VideoPress.
Learn more in VideoPress’s privacy policy.

VideoPress version of “Using theme.json with classic themes”

This particular screencast, served by VideoPress.com, is larger than its YouTube counterpart. But YouTube serves ads. Then again, your video might be discovered more on YouTube.

Core WordPress Video block with local MP4

You can upload a video to your website, host it yourself and serve it using the WordPress Video block.

On the frontend, a native HTML video element will be used for displaying the video. Playback settings like speed, captions, full-screen and picture-in-picture mode are available in all modern browsers.

The HTML video element does not rely on third-party scripts. Therefore, the “page loaded” and “player loaded” sizes are obviously the same. It doesn’t rely on cookies or track you.

Locally hosted version of “Using theme.json with classic themes”

Local hosting downsides are few but important

  • You have to compress your video manually.
  • If you want to offer different resolutions, that’s more work for you.
  • Videos are large, so hosting storage and bandwidth is a consideration.
  • You don’t benefit from YouTube’s algorithms for discovery of your video.

Personally, I like to have full control over my content and to offer a privacy respecting viewing experience, so I’m mostly hosting my videos myself.

Native MPEG-4/H.264 video resources and tips

Conclusion on Embed Privacy; what I’ve learned

It can be enabled and disabled as needed

Keep in mind, that the Embed Privacy plugin simply adds to the functionality of the core Embed blocks. It does not offer some new privacy enhanced block for you to use. That means, you can enable Embed Privacy on an existing site and reap the benefits right away—and—disable it if you don’t like it or are troubleshooting something.

Immediately reduces initial data transfer

Not loading third-party player scripts or tracking code, saves network traffic. Obviously, if the visitor chooses to play the video, scripts will load.

Improves privacy substantially

Regular embeds share visitor data with YouTube and its counterparts right away. Embed Privacy eliminates that, until the visitor actively hits play. The privacy policy is readily available to make an informed decision.

Offers automatic thumbnail generation

Thumbnails, or poster images, are created automatically for certain popular video providers, including YouTube and Vimeo. For others, a manually uploaded thumbnail can be chosen.

Automatic compression of auto-generated thumbnails

Thumbnails are stored in /wp-content/uploads/embed-privacy. These are generally poorly optimized, so if you used an automated image compression plugin for WordPress, like EWWW, consider adding that URL to the list of folders to optimize.

Embed Privacy can be customized and extended

Every WordPress oEmbed is supported out of the box, and you can customize overlay text, overlay background and link to the privacy policy.

Works on multilanguage sites, but be alert

Plugins like PolyLang allow you to create content in multiple languages. Embed Privacy fully supports that, you can for instance link to an English privacy policy for English embeds, and Danish privacy policies for Danish embeds.

Make sure you edit the Embed Privacy settings for the right language; otherwise the correct embed overlay will not kick in. Don’t ask how I know.

It is not the only kid on the block 😉

Another plugin with similar functionality is Better Core Video Embeds by HighRise Digital. Theirs differs, as far as I can see, in that it doesn’t link to privacy policies in the overlay—something you could do in the caption though—and that it supports uploading thumbnails manually to each video block. It supports YouTube, Vimeo or Daily Motion, which might be enough for you.

Embed Privacy helped reduce carbon emissions by 92%

According to Beacon the CO2 emissions per view of this very page are:

  • 884 milligrams of CO2 by default, grading F
  • 74 milligrams of CO2 with Embed Privacy, grading A+

This is, of course, true only as long as the videos are left unplayed.

Should you install Embed Privacy for WordPress?

If you embed anything? Yes, definitely give it a go. Preconfigured out of the box, it works with any embed in WordPress. You don’t have to edit your embeds in any way. Performance gains and privacy improvements are impressive. And if you don’t like it after all, disable it. It leaves no trace behind.

Read more about Bjarne Oldrup, Sønderborg

Bjarne Oldrup

Bjarne is a web developer with a passion for the sustainable, inclusive and respectful internet.

With a background as a computer technician anno 1992, he worked as a programmer, sysadmin and network specialist. Today, he focuses on website carbon footprint, web accessibility and GDPR compliance.

WordPress, HTML, CSS and LiteSpeed hosts are Bjarne's favourite tools, and the open-source community is his comfort zone.

Leave a Reply

Your email address will not be published. Required fields are marked *