How to make Facebook embeds work on WordPress

Embedded posts are a way to add your public Facebook posts including statuses, photos and videos into your webpage. If you are a publisher, embedding your own Facebook posts can help increase the exposure of your Facebook posts and its user engagement - and obviously increase Facebook likes to your fan page, which eventually can drive traffic back to your site … it’s a positive feedback loop :)

Embed Facebook Posts in Wordpress

Back in the day, if you wanted to embed a Facebook post into your website, you just needed to find the embed code of the Facebook post and paste it into the WordPress post editor wherever you want the post to appear. You can find the embed code for each post by clicking the drop down menu on the right hand side of your post.

facebook embed

However, a few months ago a WordPress publisher reported on the official WordPress support forum that the Facebook embedded posts are no longer working natively on self hosted WordPress sites. For instance, if you simply added the embed code to your post, here is how an embedded post will look like.

before-embed

Actually, here is how it should like.

after-embed

The aim of this post is to guide you on how to properly embed the Facebook posts on your self-hosted WordPress sites without having any issue. Let’s take a look…

Embedding Facebook posts on WordPress using plugin

A few years ago, Facebook released its official plugin on WordPress. Unfortunately, embeds will no longer work if you used that plugin as Facebook has stopped supporting the plugin. Fortunately, unlike the official Facebook plugin for WordPress, there are many third-party plugins in the WordPress plugins repository that support Facebook posts embedding. WP embed Facebook is one of them, which allows you to easily embed any public Facebook post on WordPress. After the plugin configuration, you can embed a public Facebook post on your WordPress by pasting its URL into the shortcode. [facebook=https://www.facebook.com/ArchanNair/videos/1015257987985069 ]

Embedding Facebook posts without using a plugin

If you are not fond of using plugins, just add the below code snippet to your header.php file.

If you are not fond of using plugins, just add the below code snippet to your header.php file. Make sure you paste the code between the <head> tags.

<script>window.fbAsyncInit = function() {

 FB.init({

xfbml      : true,

version    : 'v2.3'

 });

 }; (function(d, s, id){

var js, fjs = d.getElementsByTagName(s)[0];

if (d.getElementById(id)) {return;}

js = d.createElement(s); js.id = id;

js.src = "//connect.facebook.net/en_US/sdk.js";

fjs.parentNode.insertBefore(js, fjs);

 }(document, 'script', 'facebook-jssdk'));</script>
That’s it. You can now embed your Facebook page without any issue.

For embedding a post, go to a Facebook post, click right hand side drop down menu>> choose embed post>> copy the embed code. Then paste it into your WordPress page or post editor wherever you want the post to be embedded.

Make sure you paste the code between the <head> tags That’s it. You can now embed your Facebook page without any issue.

Download the list of 101 WordPress tricks every blogger should know

101 WordPress tricks

Click here to Download Now

One more thing...

Do you have friends or a Facebook group who you think would find this useful? Share this with them and then let me know what they think.

Want to supercharge your website?

 
Our website loads FAST ... just 1.29 seconds. We're hosted on FAST InMotion VPS servers We want YOUR website to be fast too, so we've gotten you an exclusive deal - 47% OFF for DART Creations friends + FREE domain! Check it out NOW!