Do you want to disable post oEmbed on your WordPress website?
By default, any WordPress user can embed your posts on their website using the built-in WordPress URL block. Other users can also embed third-party content on your website in a way that might damage your site’s speed and performance.
In this post, we will show you how to disable post embeds on your WordPress blog or website.
Why Disable Embeds in WordPress?
oEmbed is a technology that allows WordPress users to embed content. For example, you can embed videos in your WordPress blog posts, show images from third-party sites, and more.
With the right plugin, you can even fix the Facebook and Instagram oEmbed issue and show social media posts on your site.
This third-party content can make your site more interesting and engaging. However, it also generates an additional HTTP request to load the
wp-embed.min.js file and show the embedded content.
That said, if you don’t use embeds on your WordPress website, then disabling the embeds feature can improve your site’s overall performance.
As an added bonus, disabling this feature will also stop other people from embedding your content on their website.
By default, anyone can embed your posts in their website or blog using the built-in WordPress URL block.
WordPress will then create a card featuring your post’s title, excerpt, featured image, site icon, and links to your content.
This can introduce your website to a new audience and increase your blog traffic.
However, sometimes this feature can hurt your website.
For example, if a popular site embeds your content, then you might get a sudden spike in traffic. Depending on your WordPress hosting provider, this can negatively affect your website’s performance. You may even have to pay extra charges or buy a more expensive hosting plan due to the extra traffic.
With that in mind, let’s see how you can disable post oEmbed on your WordPress website. Simply use the quick links below to jump straight to the method you want to use:
Method 1: Disable Embeds Using Custom Code (Recommended)
The best way to disable WordPress post embeds is by using a code snippets plugin.
By using a snippet on your website, anyone who tries to embed your content using a link will end up with a blank page instead. This is particularly useful if you run an online store or membership site, as it can stop people from embedding your checkout, login, and other important pages.
The same code snippet will also disable embeds on your site, which may improve its speed and performance.
The easiest way to add code to your website is by using the free WPCode plugin. WPCode is the best code snippets plugin for WordPress that allows you to add custom CSS, PHP, HTML, and more to your WordPress website. It also has a ready-made code snippet that will disable embeds across your website.
Just be aware that this won’t remove any content that WordPress users have already embedded. However, it will stop websites from embedding any more of your content.
First, you will need to install and activate the free WPCode plugin. For more information, see our step-by-step guide on how to install a WordPress plugin.
Once the plugin is activated, head over to Code Snippets » Add Snippet.
Here, you will see WPCode’s library of pre-made snippets that you can add to your site. These include a snippet that allows you to completely disable comments, upload file types that WordPress doesn’t usually support, disable attachment pages, and much more.
To find the right snippet, just type ‘Disable Embeds’ into the ‘Search Snippets’ field.
When the Disable Embeds snippet appears, hover your mouse over it.
If you haven’t already connected to the WPCode snippets library, then you will see a ‘Connect to library to unlock’ button.
This opens a popup where you can create a free WPCode account and unlock over 50 free code snippets.
Simply type in your name, email address, username, and password. Then, go ahead and click on the ‘Register’ button.
With that done, switch back to the WordPress dashboard and hover over the Disable Embeds code snippet.
When it appears, you need to click on the ‘Use snippet’ button.
This loads the code snippet with all the settings already configured. To make the snippet live, simply go ahead and click on the ‘Inactive’ slider so that it shows ‘Active’.
You can then click on ‘Update’.
With that done, WPCode will disable embeds across your website. At the same time, the snippet will stop other websites from embedding your content.
At some point, you may want to allow embeds on your website or allow other users to show your content on their site. In this case, simply head over to Code Snippets » Code Snippets.
Here, you must find the disable embeds snippet and click to deactivate its ‘Status’ toggle.
This will disable the code snippet across your WordPress website.
Method 2: Using the Disable Embeds WordPress Plugin
If you don’t want to add custom code to your website, then you can use Disable Embeds instead. This is a simple plugin with no configuration settings, so it disables WordPress embeds upon activation.
The first thing you need to do is install and activate Disable Embeds. For more information, see our step-by-step guide on how to install a WordPress plugin.
With that done, the plugin will disable oEmbed for your posts on other WordPress blogs.
As we mentioned earlier, this doesn’t remove your content from WordPress websites. Due to how WordPress caching works, if a third party has already embedded a page or post, then it will continue to appear on their website.
Bonus: More Tips for Improving WordPress Speed and Performance
Disabling embeds in WordPress can be a great way to boost your website’s speed and performance. If you are looking for more ways to boost WordPress performance, then you can:
- Install a caching plugin like WP Rocket.
- Optimize your images in WordPress to reduce loading times.
- Use a content delivery network.
- Optimize the WordPress database.
For more details, you can see our complete guide to WordPress performance.
We hope this article helped you disable embeds in WordPress. You may also want to see our guide on how to disable directory browsing in WordPress or see our expert pick of the best SEO plugins and tools to help you get more traffic to your website.