• Resolved ofmarconi

    (@ofmarconi)


    Hello your plugin is wonderful!

    How can we disable the printing of these links:

    <link rel="alternate" type="application/json+oembed" href="https://...">

    WP-JSON OEMBED

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author christophrado

    (@christophrado)

    This is related to the oEmbed provider. I recommend using a plugin such as Disable Embeds if you don’t need or want oEmbed support.

    Thread Starter ofmarconi

    (@ofmarconi)

    Interesting! Thanks so much for the IMMEDIATE response!

    Thread Starter ofmarconi

    (@ofmarconi)

    For those who want to disable without using plugins:

    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');
    }
    add_action('init', 'disable_wp_oembeds');
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP-JSON OEMBED (TAG REL=)’ is closed to new replies.