Ticker

6/recent/ticker-posts

Ad Code

Responsive Advertisement

How to Remove oEmbed-specific JavaScript from front-end & back-end in WordPress?

How to Remove oEmbed-specific JavaScript from front-end & back-end in WordPress?

In WordPress wp_oembed_add_host_js() adds the necessary JavaScript to communicate with the embedded iframes.

/wp-includes/embed.php adds below code to your site.

function wp_oembed_add_host_js() { 
    wp_enqueue_script( 'wp-embed' ); 
}

If you have no need to load oEmbed specific Java Script in backend and frontend then you absolutely don’t need that.

On Crunchify, we have disable oEmbed Javascript in frontend and backend.

How to remove oEmbed Javascript in frontend and backend?

Just add below code to your theme’s functions.php file and you are all set.

remove_action( 'wp_head', 'wp_oembed_add_host_js' );

Any other way to disable oEmbed using plugin?

Remove oEmbed-specific JavaScript from front-end & back-end

That’s it. Hope that helps.

Get All-in-One Optimizer & Customizer WordPress Plugin

Get All-in-One Optimizer & Customizer

Simplest, most powerful, super light weight All-in-One WordPress plugin for all! 50+ Optimization, Customization & Webmaster Options in one single plugin. 🥳

The post How to Remove oEmbed-specific JavaScript from front-end & back-end in WordPress? appeared first on Crunchify.

Enregistrer un commentaire

0 Commentaires