Disable Embeds

Disable WordPress’s built-in embed functionality to remove unnecessary JavaScript, reduce HTTP requests, and prevent your content from being embedded on external sites.

Use Cases

  • Remove the wp-embed.min.js script when you never embed other WordPress posts on your site
  • Block oEmbed endpoints to prevent your posts from being embedded elsewhere without permission
  • Eliminate embed detection scripts on e-commerce sites where every millisecond counts
  • Reduce JavaScript execution time to improve Core Web Vitals scores

How It Works

When you enable this module, it:

  1. Removes the wp-embed.min.js script from your frontend pages
  2. Disables oEmbed discovery links in your page’s <head>
  3. Removes the oEmbed REST API endpoint
  4. Cleans up embed-related rewrite rules
  5. Disables the wpembed TinyMCE plugin

The result: cleaner HTML, fewer scripts, and no embed functionality.

Settings

This module has no configurable settings. Enable it to disable all embed functionality, or leave it disabled to keep embeds working.

Where to Find It

Location: Switchboard → Modules → Optimization → Disable Embeds

After enabling, verify by viewing your page source. You should no longer see:

  • <link rel="alternate" type="application/json+oembed" ...>
  • References to wp-embed.min.js

What Gets Disabled

FeatureWhat It DoesRemoved?
oEmbed DiscoveryLets other sites embed your contentYes
wp-embed.min.jsJavaScript for embed functionalityYes
oEmbed REST EndpointAPI endpoint at /wp-json/oembed/Yes
Embed Rewrite RulesURL patterns for /embed/ pagesYes
TinyMCE PluginEmbed button in classic editorYes

What About YouTube and Twitter Embeds?

This module doesn’t affect external embeds. You can still paste a YouTube or Twitter URL in your content and have it display as an embedded video or tweet. Those are handled by WordPress’s oEmbed consumer functionality, which remains active.

What gets disabled is WordPress’s oEmbed provider functionality—the ability for your posts to be embedded on other sites, and the scripts that support it.

FAQ

Will I still be able to embed YouTube videos?Yes. Pasting YouTube, Vimeo, Twitter, or other external URLs into your content works exactly as before. This module only disables the ability for your WordPress posts to be embedded elsewhere.
What’s the performance benefit?You remove one JavaScript file (wp-embed.min.js) and several DNS prefetch requests. The actual savings are modest (5-10KB), but on performance-obsessed sites, every bit helps.
Can external sites still embed my content?No. By disabling the oEmbed endpoint, external sites can’t fetch the embed preview of your posts. They could still link to your content, but they won’t get the fancy embed card.
Is there any reason to keep embeds enabled?If you want other WordPress sites (or sites using oEmbed) to display rich previews when linking to your content, keep embeds enabled. This is mainly useful for content publishers who benefit from social-style preview cards.

Combine this module with Disable Emoji for maximum frontend script reduction. Together, they remove several JavaScript files from your page load.

PRO

Get access to all 147 modules with a single license

Upgrade to Pro