Are you looking to embed Facebook video in WordPress website? Facebook videos have certainly been very popular attention grabbers on the news feed. So, embedding them on your website can boost user engagement as well as keep your visitors for a longer period of time.
In this article, we will discuss different ways to embed the Facebook video on the WordPress website. There are mainly 4 different ways. They are:
- Directly Inserting Video via Gutenberg Block
- Embedding Video Using iFrames
- Embedding Video from Facebook Video Embed API
Directly Inserting the Video via Gutenberg Block
This is the easiest way to embed Facebook video on your website as you can directly place the video on the visual editor while creating/editing posts.
For this, just copy the URL of a Facebook video.
Now paste the URL that you had copied.
After that, preview your video on the frontend. If everything is fine, click on Publish/Update to save changes.
Embedding Video Using iFrame Code
Facebook also provides you the option to embed video using the iFrame code.
To receive the iFrame code, click on more option button after selecting the video.
Then, click on the Embed option. You will be directed to the Facebook developer page.
From There, go to the iFrame tab and copy the code.
Then, go to the post editor and add a custom HTML block. Now, paste the copied code and click on the Publish/Update button and check out the frontend preview of your post.
Embedding Video from Facebook Video Embed API
An extremely useful feature for Facebook is that it has its own API to embed video players. This will allow you to easily insert the videos on various locations of your website. It means you can place your facebook video outside posts including sidebars, widgets, and widgets as well.
Firstly go to the Facebook Developer website and paste the video that you want to embed on your website.
Now click on the “Get code” button.
Then, copy the code below step 1, and paste it on the header.php of your WordPress theme.
This method will embed the Facebook Video in your WordPress website. However, it is not good to directly edit the code of your website.
So, we recommend you to create child theme or install Insert Headers and Footers on your WordPress website.
Now paste the code on the header stripe.
Then, copy the code below step 2 and paste it on any location where you want to embed the Facebook video.
Once done, click on Publish/Update button.