Hide Embed Scripts

What Is oEmbed in WordPress?

WordPress includes a feature called oEmbed, which allows users to embed content like YouTube videos, tweets, and other resources by simply pasting a URL. WordPress automatically converts these URLs into embedded content and provides a live preview in the visual editor.

While this feature is convenient, you may want to disable it for the following reasons:

  1. Performance Optimization – oEmbed scripts can slow down your website’s loading time by adding unnecessary HTTP requests and scripts.
  2. Security Enhancements – Disabling oEmbed scripts can reduce potential vulnerabilities associated with embedding third-party content.
  3. Simplified Setup – Most WordPress themes already provide built-in support for embeds, eliminating the need for additional scripts.

This tutorial explains how to disable embed scripts using WP Ghost for improved performance and security.

Hide Embed Scripts

  1. Go to WP Ghost > Tweaks > Hide Options.
  2. Switch on the Hide Embed Scripts option to remove the WordPress oEmbed library in the frontend.
  3. Click the Save button to apply the changes.
Hide Embed scripts

Note! For websites heavily relying on embeds, consider optimizing embed performance using plugins like Lazy Load for Videos instead of disabling them completely.