Disable Embeds


Disables both external and internal embedding functions to avoid slow page render, instability and SEO issues, and to improve overall loading speed.

Our related OSS projects:

The Long Version

  1. disable all oEmbed functions (e.g. disable automatic converting hyperlinks to iframe/embed HTML)
  2. prevent other sites from embed your site (outgoing embeds)
  3. prevent own site from embed other pages from own site (internal embeds)
  4. remove all embed javascript from footer

For the 1 and 4 points, I have inspected all the WP core hooks and I think I have neutralized all of them, but let me know if you detect or suspect about any client side embed related code.

There are several differences between the existing Disable Embeds plugin and this one, the main one regards to the_content filter using the autoembed function, so I do not understand why that plugin does not disable it due its importance (I suppose WP changed the way to call this filter, which he did that plugin ineffective).

Another feature is that disables completely the embeds in the WP post editor (the previous plugin only disables a deprecated TinyMCE view, so it still shows embeds).

About the 2 and 3 points, the internal query var that manages the embed display is disabled, and also the params are removed from the rewrite rules, so I think this behaviour is disabled, both for internal or external embeds attempts.

About the last point I removed the related hooks, I hope it does not cause any conflict, at the moment I have not detected any client side effects.

define('DISABLE_EMBEDS_ALLOWED_SOURCES', 'twitter, youtube');

The following sources (only) can be whitelisted using the above defined constant:

  • YouTube
  • Twitter
  • Facebook
  • Instagram
  • Scribd
  • SoundCloud
  • Reddit
  • Imgur
  • Flickr
  • Vimeo

…all other sources are blacklisted for performance reasons, including internal site URLs.

Version 1.1.0:

The code is completely refactored using namespaces and object encapsulation.

With or without the allowed sources constant, the plugin behavior removes any reference to embeds code as it did in the previous version.

But with detected allowed sources, the plugin allows the WP ‘autoembed’ filter in the post content, but limiting its execution only to the services indicated in the plugin constant, so it disables the WP autodiscovery embed feature and its associated “postmeta cache”.

Note: The supported scribd URLs must follow the format “https://www.scribd.com/doc/” or “https://www.scribd.com/doc/” to be detected by the WordPress oEmbed system, because from scribd.com portal they expose these URLs using “/document/” instead “/doc/”.


This plugin has been designed for use on LEMP (Nginx) web servers with PHP 7.0 and MySQL 5.7 to achieve best performance. All of our plugins are meant for single site WordPress installations only; for both performance and security reasons, we highly recommend against using WordPress Multisite for the vast majority of projects.

Defined Constants

The following defined constants are supported by this plugin:

  • define('DISABLE_NAG_NOTICES', true);
  • define('DISABLE_EMBEDS_ALLOWED_SOURCES', 'youtube, twitter, facebook, etc');

Plugin Features

  • Settings Page: No
  • Premium Version Available: Yes (Speed Demon)
  • Includes Media (Images, Icons, Etc): No
  • Includes CSS: No
  • Database Storage: Yes
    • Transients: No
    • Options: Yes
    • Creates New Tables: No
  • Database Queries: Backend Only (Options API)
  • Must-Use Support: Yes (Use With Autoloader)
  • Multisite Support: No
  • Uninstalls Data: Yes

Nag Notices

This plugin generates multiple Admin Notices in the WP Admin dashboard. The first is a notice that fires during plugin activation which recommends several related free plugins that we believe will enhance this plugin’s features; this notice will re-appear approximately once every 6 months as our code and recommendations evolve. The second is a notice that fires a few days after plugin activation which asks for a 5-star rating of this plugin on its WordPress.org profile page. This notice will re-appear approximately once every 9 months. These notices can be dismissed by clicking the (x) symbol in the upper right of the notice box. These notices may annoy or confuse certain users, but are appreciated by the majority of our userbase, who understand that these notices support our free contributions to the WordPress community while providing valuable (free) recommendations for optimizing their website.

If you feel that these notices are too annoying, than we encourage you to consider one or more of our upcoming premium plugins that combine several free plugin features into a single control panel, or even consider developing your own plugins for WordPress, if supporting free plugin authors is too frustrating for you. A final alternative would be to place the defined constant mentioned below inside of your wp-config.php file to manually hide this plugin’s nag notices:

define('DISABLE_NAG_NOTICES', true);

Note: This defined constant will only affect the notices mentioned above, and will not affect any other notices generated by this plugin or other plugins, such as one-time notices that communicate with admin-level users.


Free Plugins

Premium Plugins

Special Thanks


We released this plugin in response to our managed hosting clients asking for better access to their server, and our primary goal will remain supporting that purpose. Although we are 100% open to fielding requests from the WordPress community, we kindly ask that you keep the above-mentioned goals in mind… thanks!


  1. Upload to /wp-content/plugins/disable-embeds-littlebizzy
  2. Activate via WP Admin > Plugins
  3. Test plugin is working by pasting a media URL (such as a YouTube video) into your post editor


Installation Instructions
  1. Upload to /wp-content/plugins/disable-embeds-littlebizzy
  2. Activate via WP Admin > Plugins
  3. Test plugin is working by pasting a media URL (such as a YouTube video) into your post editor
How can I change this plugin’s settings?

For speed, security, and simplicity, there is no settings page.

How can I whitelist certain sources?

Please review the readme for more information about the below defined constant:

I have a suggestion, how can I let you know?

Please avoid leaving negative reviews in order to get a feature implemented. Instead, we kindly ask that you post your feedback on the wordpress.org support forums by tagging this plugin in your post. If needed, you may also contact our homepage.


Possible TEC Issues: Can’t deactivate without 500 error.

Tried this plugin out, all links now redirect to home, and I have to dig through my code and figure out why I can’t deactivate this plugin without causing a 500 error on the frontend.

Edit: Seems to be an issues with Tribe Events Calendar calling functions that no longer exist.

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘disable_embeds_rewrites’ not found or invalid function name in /www/wp-includes/class-wp-hook.php on line 286 Catchable fatal error: Argument 1 passed to Tribe__Rewrite::remove_percent_placeholders() must be of the type array, null given in /www/wp-content/plugins/the-events-calendar/common/src/Tribe/Rewrite.php on line 142

1 star was pretty harsh, bad day.

Read all 8 reviews

Contributors & Developers

“Disable Embeds” is open source software. The following people have contributed to this plugin.


Translate “Disable Embeds” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • updated plugin meta


  • plugin re-written using PHP namespaces
  • plugin uses object-oriented codebase
  • (whitelist certain embed sources using a defined constant)


  • added warning for Multisite installations
  • updated recommended plugins


  • tested with WP 4.9
  • support for DISABLE_NAG_NOTICES


  • added recommended plugins notice
  • added WP.org rating request notice


  • initial release
  • tested with PHP 7.0