To remove WordPress oEmbed related items, you can use the wp_oembed_remove_provider
function in your theme’s functions.php
file. This function allows you to remove oEmbed providers that are registered with WordPress, which will prevent WordPress from attempting to embed content from these providers using the oEmbed API.
Here’s an example of how you can use the wp_oembed_remove_provider
function to remove an oEmbed provider:
// Remove oEmbed related items
// More snippets at wpunplugged.com
wp_oembed_remove_provider( 'https://www.youtube.com/oembed' );
This code will remove the YouTube oEmbed provider from the list of registered providers, which will prevent WordPress from attempting to embed YouTube videos using the oEmbed API.
You can use the wp_oembed_remove_provider
function multiple times to remove multiple oEmbed providers from WordPress. For example:
// Remove oEmbed related items
// More snippets at wpunplugged.com
wp_oembed_remove_provider( 'https://www.youtube.com/oembed' );
wp_oembed_remove_provider( 'https://vimeo.com/api/oembed.json' );
wp_oembed_remove_provider( 'https://www.instagram.com/oembed' );
Keep in mind that removing oEmbed providers may not always be necessary or desirable, depending on your specific requirements and use case. For example, if you use oEmbed to embed content from these providers on your site, removing the providers may prevent you from being able to embed this content. You should carefully consider the implications of removing oEmbed providers before doing so.