WordPress oEmbed Plus: Facebook and Instagram content embed
WordPress supports embedding external content such as Facebook videos, Instagram photos, YouTube videos, etc from the URL.
The URL input is turned into an embeded Facebook video:
WordPress uses oEmbed
Internally, WordPress block editor uses oEmbed protocol and a legacy Facebook API to fetch post/photo/video/etc content and embed the HTML in the post.
Facebook deprecates legacy oEmbed API on 2020 October 24
The legacy API WordPress used to fetch embed contents did not require any credentials such as an access token to function, which made it possible to embed Facebook and Instagram content without any additional configuration.
Facebook is to deprecate the legacy oEmbed API on 2020 October 24.
Due to this change, WordPress 5.5.1 plans to remove Facebook and Instagram content embed support and hand over this functionality to a third party plugin.
Facebook and Instagram embeds with a plugin
The new self-plug WordPress plugin oEmbed Plus brings back the support for Facebook and Instagram oEmbed using Facebook's new API endpoints.
Once installed, this plugin needs to know a Facebook App access token to function. You can set the API key and secret in Admin Dashboard → Settings → Writing.
Register a Facebook app
With a Facebook acccount and logged into it, head to Facebook Developer Apps list to create a new app. Click "Add a New App", and select "For Everything Else" for the use of it.
You will need to enter a name for the app and an email. The app name can be any name. Name and email will not be shown in the WordPress front end at all.
Add oEmbed to the app
Once the app is created, you need to enable oEmbed feature for the app.
From the "Products" list, add oEmbed by clicking "Set Up".
Enter additional App details
In order to complete and retrieve API keys, the app needs to be live and complete.
Switch App to Live mode
Using the toggle on the top of the page that says "In Development", you can now switch the app to live mode.
You will be asked to enter additional details if anything is missing.
Get App ID and Secret and enter in plugin settings
To retrieve the App ID and Secret key, go to Settings → Basic in the Facebook app. You will see the App ID and Secret, which you can enter in the WordPress oEmbed Plus settings.
Set App ID and secret in settings file
As an alternative to setting the Facebook App ID and secret from the Administration settings page, it is also possible to set it in the
In a typical WordPress setup, the root
wp-config.php file contains various settings for the site. Edit this file, and at the end of the file, set the Facebook App ID and secret by adding the snippet below:
define('OEMBED_PLUS_FACEBOOK_APP_ID', '<Enter App ID Here>'); define('OEMBED_PLUS_FACEBOOK_SECRET', '<Enter Secret Here>');
<Enter App ID Here> and
<Enter Secret Here> fields with the real values. Make sure to remove the
< > markers as well. For example, a configured value would look like this:
define('OEMBED_PLUS_FACEBOOK_APP_ID', '123...456'); define('OEMBED_PLUS_FACEBOOK_SECRET', '123456abc...789def');
If configuration options are set in the
wp-config.php file, the Administration dashboard form will be disabled, and
wp-config.php file configuration will take precedence over Administration dashboard form settings.
That's it. Your existing embedded content will continue to work (as they are stored as rendered HTML content). New Facebook and Instagram content will use the new authenticated API.
Facebook allows up to 5 million requests a day. Once the content is embeded, the output is cached in the database, and it does not trigger any further requests.
Please check out the Git repository Ayesh/WordPress-oEmbed-Plus. PRs and issues are welcome!