Remove oEmbed Discovery Link Tag

By default WP supports oEmbed which allows users to add media content (videos, music, images etc.) within their post very easily. WP has pretty good documentation of this service which could be particularly useful for certain users.

However, I personally do not want to use this service as I barely add contents from third party web sites. oEmbed adds two different tag line on your site’s header section. Removing them seems to disabled this service automatically. These tags looks something like this.

<link rel="alternate" type="application/json oembed" href="" />
<link rel="alternate" type="text/xml oembed" href="" />

Now, in order to remove them, you just simply need to copy and paste the following snippet on your current theme’s functions.php page and you are good to go.

// removes oembed discorvery link
remove_action('wp_head','wp_oembed_add_discovery_links', 10 );

Do not forget to update your functions.php page. Go to the front-end of your site and refresh your page. You shouldn’t be seeing the tags on your site’s header section anymore. Hope that helps.

Today In History




  1. Anton PorkhunPublished: 5 years ago

    Thanks a lot.

    • Iftekhar BhuiyanPublished: 3 years ago

      You are welcome.

Leave a Reply

Note: Convet HTML, PHP, JavaScripts from HTMLify, before posting from comment section.
License: By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution. Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.