What's WP
Our everything is about WordPress - best choice of WordPress users!
How to Add Facebook Video in WordPress Sites

How to Add Facebook Video in WordPress Sites

Facebook is one of the most popular social media platforms on the web, along with millions of active users participating on it each day. Due to this great popularity and user base, more and more WordPress users connect their websites with Facebook tightly to achieve the successful Facebook marketing to drive more traffic, such as adding Facebook button, embedding Facebook posts and creating the special Facebook brand page.

This time, we’d like to introduce another way for this integration by adding the Facebook video in WordPress sites. Frankly speaking, this practice greatly increases the online engagement for your website readers and Facebook followers.

Create Facebook Video in WordPress

First of all, you should target the Facebook video that you want to add to your WordPress sites, and copy its link address.

Then, you can make use of the Embedded Video Player of Facebook, with which you can transfer the URL of your target video to some special lines of coding stuff that are required to embed to your website.

Facebook Video Code Generator

Before generating the code, you need to decide the width of the video to fully meet the overall design of your webpage. Then, click the “Get Code” button.

Now, you can be presented with two boxes of codes in a pop-up window that are required to be entered into your site in a different way.

Facebook Video Codes

JavaScript SDK

The coding stuff showcased into the first box needs to be pasted into the header section of your site right after the opening “body” tag. Here, you can do this via two methods.

Modify the Code via WordPress Admin

WordPress gives you much freedom to edit your theme file. For this, you only need to log into your WordPress dashboard and click the Editor button under then Appearance option at the left-hand column. Then, you should target the header.php file among dozens of template files from the right hand of the screen, find the “body” tag and paste the lines of codes after it.

Use the Insert Headers and Footers Plugin

If you are not comfortable in editing your website files, you can choose to use this plugin. After installing and activating it, you simply need to go to the Settings tab of your WordPress admin and click the name of this plugin under the drop-down menu. Then, enter the coding stuff into the blank field of “Scripts in Header”.

Insert Headers and Footers Plugin

Codes for Embedding the Facebook Video into WordPress

The second box of codes can be directly pasted into your blog posts, webpages and even the sidebar widget.

In fact, this part of coding stuff only contains the general settings of the absolute URL of your embedded video, the width of its container, as well as the video title and posted date. However, you can also add the following attributes manually into the generated coding stuff for some other configurations.

  • If you want your Facebook videos to be showcased in a full-screen mode, you can enter the line of data-allowfullscreen=”true”.
  • If you want to achieve an automatic video playing when the webpages load, you can enter the line of data-autoplay=”true”.

Special Note

The first part of code only needs to be pasted for one time. Therefore, the next time you embedding the Facebook video, you only need to paste the second box of code into your preferred location.

Two Simple Alternative Ways for Adding Facebook Videos

Option 1

If you check the Facebook video by entering its link address into the address bar, you can find an “Embed Video” button. After clicking it, you will be presented with a special line of code that needs to be pasted at any location you prefer within your pages, posts and sidebar.

Without doubt, this method is much more time-saving than the previous one, but it may lead to more bandwidth consumption when loading the video.

Option 2

If this video is shared by other Facebook users but not you, you can firstly reshare it on your Facebook profile. Then, you only need to embed this special Facebook post into your WordPress site.

The downside of this option is that you cannot showcase the video purely on your posts. Also, this method disallows you to embed the video into your webpage sidebar.


Susan Rose is a freelance writer who has a deep knowledge about WordPress. She loves everything related to website building since the freshman year at Christopher Newport University, and loves to share her experience with people all over all the world. This girl is popular among our readers as she is outgoing and energetic. In the daily life, Susan loves detective novels as it can train her logical thinking and creativity.


Want to Learn More About WordPress?

Get Our Free Themes, Plugins, Support, SEO Tips, and Other Tutorials!

Email *