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?
- Download plugin All-in-One Optimizer and Customizer Plugin.
- Enable toggle for below two options:
- Remove oEmbed discovery links
- Remove oEmbed-specific JavaScript from front-end & back-end
That’s it. Hope that helps.
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.
0 Commentaires