Skip to main content
Agency Program Get 2× more leads and save 50% on hosting. Built for agencies ready to grow. Book a call
Embed Optimizer icon

Embed Optimizer

v1.0.0-beta1

Optimizes the performance of embeds by lazy-loading iframes and scripts.

30K+ active installs Updated Feb 14, 2025 Tested to 6.7.2 Requires PHP 7.2
Try Demo Download
Pre-installed Ready in ~10s No card
Embed Optimizer

About Embed Optimizer

This plugin optimizes the performance of embeds in WordPress by lazy loading them, adding preconnect links for resources used by embeds, and reducing layout shifts caused by resizing embeds. It is recommended to install and activate the Optimization Detective plugin alongside Embed Optimizer for additional optimizations. There are no settings or user interface for this plugin as it is designed to work without any configuration.

Frequently asked questions

What is the purpose of the Embed Optimizer plugin?
The plugin optimizes the performance of embeds in WordPress, such as Tweets, YouTube videos, and TikToks. It achieves this by lazy-loading iframes and scripts, adding preconnect links for initial viewport embeds, and reserving space to reduce layout shifting.
How does lazy loading improve performance?
Lazy loading improves performance by ensuring resource-intensive embeds don't compete with other resources during page loading. IFRAME-based embeds are lazy-loaded using the loading=lazy attribute, while script-based embeds use an Intersection Observer to dynamically insert script tags when they enter the viewport.
Why is the Optimization Detective plugin recommended?
The Optimization Detective plugin is recommended because it unlocks additional optimizations beyond just lazy loading. Without it, lazy loading can degrade performance for embeds in the initial viewport by delaying rendering, impacting LCP. Optimization Detective detects if an embed appears in breakpoint-specific viewports (mobile, tablet, desktop) to prevent this.

Changelog

1.0.0-beta1

Enhancements

  • Bump version to 1.0.0-beta1 to indicate graduation from being experimental. See 1846.
  • Use CSS range syntax in media queries. (1833)

0.4.1

Bug Fixes

  • Remove requirement for both mobile and desktop URL metrics to be collected for preconnect links to be added. (1764)

0.4.0

Enhancements

  • Incorporate media queries into preconnect links to account for whether embeds are in viewport. (1654)
  • Serve unminified scripts when SCRIPT_DEBUG is enabled. (1643)

0.3.0

Enhancements

  • Leverage URL Metrics to reserve space for embeds to reduce CLS. (1373)
  • Avoid lazy-loading images and embeds unless there are URL Metrics for both mobile and desktop. (1604)

0.2.0

Enhancements

  • Facilitate embedding of Embed Optimizer. (1337)
  • Leverage Optimization Detective to optimize embeds in Embed Optimizer. (1302)

0.1.2

Enhancements

  • Improve overall code quality with stricter static analysis checks. (775)
  • Bump minimum PHP requirement to 7.2. (1130)

Bug Fixes

  • Hide post embed iframes with visibility:hidden instead of clipping. (1192)

0.1.1

  • Use plugin slug for generator tag. (1103)
  • Bump minimum required WP version to 6.4. (1076)

0.1.0

  • Initial release.

Try other plugins

Really Simple SSL icon

Really Simple SSL

4.9 · 4M+ installs

The easiest way to improve security! Leverage your SSL certificate and protect your website visitors.