How to Fix Facebook oEmbed Issue in WordPress

How to Fix Facebook oEmbed Issue in WordPress

Facebook and Instagram no longer work with WordPress oEmbeds. In this article, we discuss how you can easily enable oEmbed endpoints on your website with a few simple tweaks. 

Table of Content

What is oEmbed Issue on Facebook?
What happened to oEmbeds on Facebook & Instagram?
Fix Facebook oEmbed Issue in WordPress
Create Facebook App ID to Enable oEmbeds
Plugin for Facebook & Instagram oEmbed Issue
Add Facebook App ID to oEmbed WordPress Plugin
Manual Method: Enable Facebook oEmbeds with Wp-config File
Facebook oEmbeds: Who Should Enable Embeds?
Wrapping Up!

WordPress by default comes with a functionality that allows users to easily embed media such as images and videos to their posts and pages without any external help. Previously, they had to get the embed code from the websites and manually add it to the code of their posts/pages. This changed when WordPress introduced oEmbed. 

With oEmbed, users just had to copy the video URL and add it to the oEmbed box in WordPress, and voila! The video or audio file was automatically fetched by the system.

WordPress oEmbed Example

As of now, WordPress allows oEmbeds from all trusted sources including YouTube, Facebook, Instagram, Vimeo, Dailymotion, Imgur, Giphy, and much more available in the list here.

What is oEmbed Issue on Facebook?

Recently, however, Facebook has deprecated the oEmbeds. The depreciation means that users won’t be able to embed data from either Facebook or Instagram any longer. The already existing embeds will appear as text posts and nothing else. For Instagram, currently, the embeds will show a 404 message or the message that ‘The post can’t be displayed’.

What happened to oEmbeds on Facebook & Instagram?

The main reason Facebook removed the oEmbed endpoints was that they were infringing copyrights. Now, new oEmbed endpoints will be released for embedding content from Facebook. They would require the embedding party to have a Facebook app ID to enable the embed requests. 

Although all this may sound difficult for beginners, you don’t have to worry. WordPress is automatically working on a method to fix the oEmbed issue. It has already removed Facebook and Instagram endpoints from the current oEmbed tool.

Fix the Facebook oEmbed Issue

Currently, the only way to embed images, audios, and videos from Facebook or Instagram is through a plugin called oEmbed Plus.  It helps implement new endpoints to enable Facebook and Instagram oEmbeds on your WordPress website.

But before you install the plugin on your WordPress website, make sure that you have PHP 7.3+ version available on it. Otherwise, the plugin will simply not work. 

Create Facebook App ID to Enable oEmbeds

Next, you will have to create a Facebook app id and enable oEmbeds on your website. Facebook developers column makes it easier to create an app id.

Plugin for Facebook & Instagram oEmbed Issue

Go to the Facebook developer’s corner and create an App ID for your business. In our case, our business is our website. So, we will simply create an App ID called ‘My Website’.

Create an App

Now you will have to select an integration, which is the oEmbed integration in our case. So we will just select the oEmbed integration and enable it on our website.

oEmbed Setup

Once I have the oEmbed plugin integrated into my app, I just need the App ID and the App Secret. Both will be available in the ‘Settings’ left-hand column of the app. 

To retrieve the App Secret ID, simply click on Basic or Advanced settings and a window will open up.

App Secreat

Add Facebook App ID to oEmbed WordPress Plugin

Now you just have to add the App ID found in the Facebook Developers section to the WordPress plugin that we previously downloaded. When you go to the oEmbed plus plugin, you will see that it shows App ID and App Secret fields. Simply copy the code you have retrieved from Facebook App and add it to the columns. That’s pretty much it. No hard coding needed to enable Facebook oEmbeds to your WordPress website.

Add Facebook App ID to oEmbed WordPress Plugin

Manual Method: Enable Facebook oEmbeds with Wp-config File

There is a manual method available to enable Facebook oEmbeds with the wp-config file. To use this method, you should have access to your WordPress installation. Once you have that, simply copy the following two lines to your wp-config.php file.

define(‘OEMBED_PLUS_FACEBOOK_APP_ID’, ‘7168…app.id…789’);  

define(‘OEMBED_PLUS_FACEBOOK_SECRET’, ’20e5…app.secret…890xyz’);

That is literally it!

You are done. The oEmbeds are now enabled on your WordPress website and you can use them as freely as you want. Facebook allows up to 5 million embed requests per day using a single app, so you can use the embed feature wholeheartedly. 

A few things to keep in mind while using Facebook oEmbeds on WordPress:

  • Facebook only allows one app per website. You won’t be able to embed Facebook or Instagram content without enabling oEmbeds on your website. The above process simplifies that for you.
  • You don’t have to add any other integration to enable oEmbeds. Enabling a lot of integrations in your app will make the app load-intensive and there is a chance that the app will take more time to load oEmbeds with all those extra integrations.
  • WordPress caches embeds through its database, so once an embed is loaded it is shown through the database hence counted as a single request. You can read the complete Facebook oEmbed guide here.

Facebook oEmbeds: Who Should Enable Embeds?

If you have a website that uses oEmbeds to add Facebook content such as images, videos, and other metadata or content, then enabling oEmbeds would be a good idea. Without these oEmbeds, your iframe will show a 404 message or a blank area. Users visiting your website to look at the oEmbeds will have a bad user experience because they won’t be able to find anything and will leave your website. This will lead to lower average onsite time and higher bounce rate.

Enabling Facebook oEmbeds is easier than you think. You simply have to add the Facebook App id and App secret to your WordPress installation. We have provided the complete process of how to enable Facebook and Instagram oEmbeds to your website in the above content. 

Wrapping Up!

If you are still not sure or are not able to understand this process, let us know in the comments below and we will help you get the issue fixed on your website individually.

Leave a Comment

Your email address will not be published.