How to embed Facebook videos, auto play in WordPress


If you are active on Facebook, you have probably noticed that native Facebook videos to play automatically.

But what you may not know is how this AutoPlay switch for Facebook has been very successful. She went from only 1 billion video views per day in 2014 on about 8 billion views per day at the end of the year 2015. That’s a pretty big increase in commitment, right?

It did not like Facebook users increased by 800% in a year. some argue that these counts are inflated, because how Facebook views count. And it’s definitely some truth. But no matter what, this is not true with an increase in that massive. Videos get engagement video content by users.

To help, this power for your website use, this post will show you to embed video content Facebook videos in your WordPress site. Used correctly, these videos can accent of your WordPress site and your commitment to increase. You have also a positive side effect of cross promoting your Facebook page on your WordPress site.


How to embed video content of Facebook videos in WordPress:

Unfortunately to make Facebook videos AutoPlay you can embed a simple IFRAME. Instead you must file header.php add a piece of code your WordPress theme and use you then a

Embed code offered by Facebook, to view these videos in your posts contain.

here all what you need to do is:

  1. Add the Facebook JavaScript SDK on your WordPress theme header.php file.
  2. The direct URL of video to your desired Facebook video to find. generate
  3. Add the embed code to your WordPress post or page.
  4. embed code to easily customize, make the video AutoPlay. I’ll show you how every step to do…

1. How Facebook JavaScript SDK to WordPress

Add to get started, you need to your topic to find header.php. Many premium themes offer methods to do this from within the theme options panel, but you can do it also, on “appearance” → “Editor” and on the search for the file header.php.

Should ideally do this in a child theme, but if you have a file header.php in your child theme, you can add it to your regular theme. Keep in mind that you may re-add the code, if you update your theme.

If you want to add the code directly in your header.php, you must findtag:


Then, you need to make Facebook embedded video & live video player page, to get the JavaScript SDK code:


Copy and paste this code , tag in the header.php file. It should look like after you are done:


Make sure that you save your changes. It’s about what that must do to add WordPress Facebook JavaScript SDK!

2. The direct URL by Facebook video embed

As find next, you need to find that you want to include the actual URL for the video. To achieve this, there is a Facebook post that contains a video. If you are surrounded by your own videos, you can go on your side.

Then the right mouse button on the video and select “show video URL” :


A box should appear, contain the exact URL:


Just copy this URL and keep handy’s use in the next step.

3. Generating the embed code and paste it to WordPress

Now have the URL of the video you can Facebook’s embedded video player Configurator. Enter the URL in the box and choose the width that you want to be your embedded video:


You must also decide whether the Facebook post, or just the video to take on the full text. Button, click get code beneath the video preview:


Opens a window with the embed code you need. Since you have already added to the JavaScript SDK, you can ignore the first block of code. You simply copy the code in “step 3” , which I pointed out:


You can now add this code in the tab text your WordPress editor or page Builder, the video embed. You must take another step actually the video AutoPlay carry out, BUT.

4 Embedded Facebook videos AutoPlay

Your embedded video playback automatically need to make, add a short piece of code, made available to the embed code Facebook. Unfortunately possible add this code not Facebook, directly from their embed tool.

Here is the piece of code you need to add:

data AutoPlay = "True"

You must add this in the < div class = "fb-video" of the code. See how I added the code to the end before the closing parenthesis? It is a little tricky if you are not familiar, but only to follow this example with code and it work, “OK”.

Once you have made that change, your video should be the AutoPlay on WordPress. Of course, just like with Facebook, muted until your visitors click on your videos. the embed Facebook videos via IFRAME

If you do not want your videos to AutoPlay a simple way, they incorporate is over an IFRAME. With this method, you must add not the Facebook JavaScript SDK to your site. This means that you need to edit not code. You must embed code to insert the IFRAME directly into your posts or pages as you would with a YouTube video.

To find the embed code, arrow click on the top right down a Facebook video post. Then select the “embed” option :


A window will pop up with the IFRAME embed code:


Add this code on the tab, your WordPress editor a text non-video content to embed Facebook video.

Final thoughts

As with any strategy, you should not abuse video content videos. Embed videos is a good way to increase commitment to your WordPress site and your Facebook page strategically. But if you embed videos to many video content, you will probably annoy your visitors to damage the user experience on your site.

So, moderation is the key. These videos sparingly around and they are a great addition for your WordPress website.

Let you know, if you have any questions about the process. It’s pretty simple, but I’m sure that the existing video auto play add code can embed code be a little confusing for some people. Share your questions with me in the comments!