{"id":16953017,"date":"2023-08-07T13:14:14","date_gmt":"2023-08-07T13:14:14","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/remove-oembed\/"},"modified":"2023-08-07T13:14:14","modified_gmt":"2023-08-07T13:14:14","slug":"remove-oembed","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/remove-oembed\/","title":{"rendered":"Remove oEmbed"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello, I would like to know if you intend to disable OEMBED too, currently I use a code snippet:<br \/><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function disable_wp_oembeds() {\n  \/\/ Remove the REST API endpoint.\n  remove_action('rest_api_init', 'wp_oembed_register_route');\n  \/\/ Turn off oEmbed auto discovery.\n  add_filter('embed_oembed_discover', '__return_false');\n  \/\/ Don't filter oEmbed results.\n  remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);\n  \/\/ Remove oEmbed discovery links.\n  remove_action('wp_head', 'wp_oembed_add_discovery_links');\n  \/\/ Remove oEmbed-specific JavaScript from the front-end and back-end.\n  remove_action('wp_head', 'wp_oembed_add_host_js');\n  \/\/ Remove oEmbed from comments\n  remove_filter('comment_text', 'do_shortcode', 11);\n  \/\/ Remove oEmbed CSS styles\n  add_filter('embed_oembed_styles', '__return_false');\n  \/\/ Remove oEmbed from RSS feeds\n  remove_filter('the_content_feed', 'wp_staticize_emoji');\n  remove_filter('comment_text_rss', 'wp_staticize_emoji');\n}\nadd_action('init', 'disable_wp_oembeds');\n<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-16953017","topic","type-topic","status-publish","hentry","topic-tag-oembed"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16953017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16953017\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16953017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}