Recently WordPress has been updated Version 4.5.2. Suddenly in this summer you noticed that in WordPress front-end, a javascript named wp-embed.min.js is loading. Here is How to Remove WordPress wp-embed.min.js & Embed Stuffs. If you have suddenly, accidentally discovered the wp-embed.min.js, the story is so long that we have a separate article on WordPress Embed and oEmbed.
Remove WordPress wp-embed.min.js : Really More Stuffs
Many of us who do not know because it is a relatively new promoted system. If you suddenly discovered today, first open your website’s some webpage in a browser, open the “page source”. Opera browser is great tool for these checking works :
Cleaning from that source, these are added :
---
1 2 3 4 5 | <link rel='https://api.w.org/' href='https://thecustomizewindows.com/wp-json/' /> <link rel="alternate" type="application/json+oembed" href=".../wp-json/oembed/1.0/embed?url=..%2F" /> <link rel="alternate" type="text/xml+oembed" href="...com/wp-json/oembed/1.0/embed?url=...%2F&format=xml" /> <style type="text/css">.wpcp{background:#f7f7f7;padding:16px 20px;border-radius:5px;line-height:20px}</style> |
In order to remove, first you have to read this guide to avoid adding snippets on Theme’s functions.php. That is our older, easy way. For WordPress’s hundreds of new stuffs, we made that easy plugin difficult now, it is factually a WordPress Plugin to add as many types of snippets as possible.
Remove WordPress wp-embed.min.js & Embed Stuffs
Only for writing this guide, we wrote two other article, which are linked. Otherwise it is not possible to explain.
1 | <link rel='https://api.w.org/' href='https://thecustomizewindows.com/wp-json/' /> |
Normal users probably do not need these. We are in third decade of life, already has been old human. Obviously I have reserved abhishekghosh.slack.com
against abhishekghosh.pro
domain but Email is better for us. Anyway, these are four stuffs we need for filtering. Sadly, one of them runs to filter each post header :
1 2 3 4 5 | remove_action( 'wp_head', 'rest_output_link_wp_head', 10 ); remove_action('template_redirect', 'rest_output_link_header', 11, 0); remove_action( 'wp_head', 'wp_oembed_add_host_js' ); remove_action('rest_api_init', 'wp_oembed_register_route'); remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10); |
That is made a bundle and PHP_INT_MAX
added. This is what human currently using and apparently working :
1 2 3 4 5 6 | add_action( 'init', function() { remove_action('rest_api_init', 'wp_oembed_register_route'); remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10); remove_action('wp_head', 'wp_oembed_add_discovery_links'); remove_action('wp_head', 'wp_oembed_add_host_js'); }, PHP_INT_MAX - 1 ); |
This plugin is really good as there are so many to exclude :
1 | https://wordpress.org/plugins/disable-embeds |
Previously we used WordPress Plugins to extend the functions, it is sad that now we need to use the WordPress Plugins to limit the functions.
Tagged With what is a wp-embed min file? , wp-embed min js , /wp-json/oembed/1 0/embed?url= , exclude wp-embed js , remove embeding in wp , remove wordpress embed , remove wp_embed , wp-embed min js ? , wp-embed-min