Remove oEmbed | WordPress.org

[ad_1]

Hello, I would like to know if you intend to disable OEMBED too, currently I use a code snippet:

function disable_wp_oembeds() {
  // Remove the REST API endpoint.
  remove_action('rest_api_init', 'wp_oembed_register_route');
  // Turn off oEmbed auto discovery.
  add_filter('embed_oembed_discover', '__return_false');
  // Don't filter oEmbed results.
  remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);
  // Remove oEmbed discovery links.
  remove_action('wp_head', 'wp_oembed_add_discovery_links');
  // Remove oEmbed-specific JavaScript from the front-end and back-end.
  remove_action('wp_head', 'wp_oembed_add_host_js');
  // Remove oEmbed from comments
  remove_filter('comment_text', 'do_shortcode', 11);
  // Remove oEmbed CSS styles
  add_filter('embed_oembed_styles', '__return_false');
  // Remove oEmbed from RSS feeds
  remove_filter('the_content_feed', 'wp_staticize_emoji');
  remove_filter('comment_text_rss', 'wp_staticize_emoji');
}
add_action('init', 'disable_wp_oembeds');

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer