Disable Embed Scripts Without Plugin in WordPress

Disable Embed Scripts Without Plugin to make your WordPress site load faster. Here’s how to remove the embed script with a simple tweak.

Step 1: Add the Embed Scripts Disable Code

Add this to your child theme’s functions.php:


// Disable WP Embed script
function qdt_disable_embed_scripts() {
  wp_deregister_script(‘wp-embed’);
}
add_action(‘wp_footer’, ‘qdt_disable_embed_scripts’);

How It Works

This snippet removes the default oEmbed JavaScript file that WordPress automatically adds to every page, saving an extra HTTP request.

Why Disable Embed Scripts Without Plugin?

If you don’t use oEmbed for things like tweets or YouTube videos, this script just adds unnecessary load time. Removing it can slightly boost page speed.

Common Mistake

Disabling embeds means you can’t easily embed rich media. Always test your posts if you use embedded content regularly.

Pro Tip

Place this tweak in your child theme’s functions.php so it remains active after theme updates.

Related Snippet

If you liked this, check out my guide on disabling Gutenberg without a plugin in WordPress.

Leave a Comment