Less crappy Twitter embeds please!

WordPress has allowed embedding third-party content in posts and on pages for ages. In the classic editor, it was possible to simply paste a link to a popular external service like Twitter, Soundcloud, YouTube, etc. Using a clever format called oEmbed, WordPress could retrieve the linked content from the respective platforms and embed it in its content. Today there are separate blocks for the individual providers in the block editor, but nothing has changed in the basic principle of this mechanism.

The whole thing is perfect for integrating videos, putting tweets in a larger context, or presenting your music. But as is often the case, there’s a downside to it. The negative side effects of embedded content are manifold.

The problem with embeds

What may not be apparent to everyone at first: by embedding content, we load small websites in iFrames in addition to our own site. In many cases, this has a noticeable negative impact on the performance of our website. A lot of additional data has to be transferred and interpreted by the visitor’s browser. The result is slower websites and significantly increased power consumption.

The second big problem is data protection. Since the GDPR, we hopefully all know that it is problematic to embed content from third parties. As soon as my website with an embedded tweet is accessed, Twitter, whose website is also loaded via the embed, can track visitors to my site just as I could (but don’t).

The obvious solution

Anyone who is occasionally on the web knows at least one two solutions to this problem.

The first would be to consistently not use embedded content. For a lot of websites, this is a great solution.

Screenshot eines Datenschutz-Overlays für einen, auf Netzpolitik.org eingebetteten Tweet.
Like here on Netzpolitik.org Netzpolitik.org, Embed Privacy already hides external content behind a placeholder.

If you don’t want or can’t work without embedding tweets and the like, you can use a so-called two-click solution. For this, embedded content of all kinds is replaced by a placeholder. The external content only replaces this placeholder with the explicit consent of the visitor. Our free Embed Privacy plugin does exactly that and offers a delicate middle ground between the interests of publishers and visitors. But that’s not enough for me.

Thought one step further

A two-click solution is excellent, but it only postpones the two problems mentioned above to a later point in time. The additional data still has to be transferred, the privacy of the visitors still has to be compromised. Both are under the complete control of the reader, but even this solution is not optimal.

Enter: Local Tweet Caching. In the latest Embed Privacy version 1.3, which we released yesterday, a new option allows local caching of tweets from now on. Once saved in WordPress, tweets can then be output as pure HTML. After the update, all you have to do is enable the “Local Tweets” option on the settings page under Settings / Embed Privacy. After that, the local copies of embedded tweets are formatted like blockquotes. Thanks to a tiny bit of additional markup, local tweets can also be adapted to the design of your website with just a few lines of CSS.

Without any cumbersome embed code or overlay, tweets can now simply be served locally.

I’m excited to see how people who actually know design (unlike me) will handle this new tool. I’m looking forward to seeing properly designed embeds that end up benefiting much more than just performance and privacy.

That’s it?

Yep, that was basically it. To anticipate an inevitable comment right away: yes, tweets can also be manually copied and pasted as text into WordPress. The advantage of our solution is that the charming original workflow (copy URL, paste into WordPress, done) remains untouched and Embed Privacy does all the heavy lifting in the background. Also, of course, the whole thing takes effect for all already created embeds as well.

On our wish list is still the (optional) local caching of images. In the future, there will probably be another option for this. In this first step, version 1.3 will be limited to plain text for now.

Embed Privacy 1.3 is now available on WordPress.org.