All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:
oEmbed provides an easy way to embed content from one site to another. You’re probably familiar with it on sites like YouTube and Twitter. But what if you don’t want other sites embedding your stuff? In that case, this snippet is for you.
Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly add code snippets in WordPress, so you don’t accidentally break your site.