Embed Facebook Posts in WordPress

Updated November 15th, 2017
Updated November 15th, 2017
Share this post:

Facebook, whether we like it or not, is here to stay. One good piece of evidence is the site’s popularity not just with teenagers, but even the senior age group. It hardly seems an exaggeration to say that “everyone” is on Facebook.

Another piece of proof is the engagement and click-through rates that the social network is able to give companies with Facebook Pages. Compared to Twitter, which is able to function mostly as a news ticker for followers of companies and groups, Facebook is able to deliver site visits.

There are downsides to this, of course. In the future, what if the social network drops, or users lose interest in communicating over the platform? Websites cannot rely on Facebook alone to deliver hits or to engage with the audience. However, at this point in time, the relevant question still seems to be—if you do not yet have a Facebook page for your website, why have you not yet gone and made one?

If you already have one, now is the perfect time to be able to show your posts on your WordPress site. This will hopefully increase engagement both on the site and other platforms. There is a downside to embedding posts on Facebook, however. If the post is deleted on Facebook, or if the post’s privacy settings are changed, it will also no longer be visible on your website.

Use the Facebook plugin

Facebook has an official plugin for WordPress, which can be installed from the WordPress site. Among its many features, it allows us to embed Facebook posts in WordPress. This can be done by pasting a URL into the compose post box, through the use of a shortcode, or calling a theme function.

The shortcode which allows the embedding of a post is as follows:

[facebook_embedded_post href="{$facebook_post_url}"]

Aside from posts, enabling of the Facebook Comments Box social plugin can allow comments from users who are logged in to Facebook. It will be just like commenting on Facebook—only this is being done on your website. The plugin can also allow the automatic sharing of new posts to a Facebook Page. This means there will be no need to use a third party application to push updates to the popular social media site.

Aside from the automatic sharing of new posts, the plugin can also optimize content for sharing on Facebook and other social media platforms such as Twitter and Google+. It also allows the use of Facebook insights to track traffic, and see how WordPress articles are shared on Facebook.

Readers can also have more opportunity to interact with your posts, as the plugin adds like, send and follow buttons.

Use the Facebook embed code

Another way to embed Facebook posts in your WordPress website is by using the embed code generated by the social media site for your post. Only public posts can be embedded into a website, whether these are from a Facebook Page or a personal profile.

The embed code can be found by clicking on the icon that is on the top right corner of the post on Facebook, then by clicking on “Embed Post” from the dropdown (see screenshot below).

Embed Facebook Post Link
Embed Facebook post link in drop down menu.

The Embed Post dialog box will pop up showing the code, which can be copied and pasted into the source code of your post.

Embed Facebook Link Dialog Box
Embed Facebook link dialog box that pops up after you click the Embed Post link

The width of embedded posts can be adjusted by changing the width in the Embed Post dialog box. However, embedded posts adjust automatically if a page visitor is on mobile. The embedded post will show any photos or videos attached to the post, and will show the number of shares, comments and likes that the post has received on Facebook.

Share this post:

Responses

Your email address will not be published. Required fields are marked *

WPLearningLab

Warning: Use of undefined constant WPBF_CHILD_THEME_URI - assumed 'WPBF_CHILD_THEME_URI' (this will throw an Error in a future version of PHP) in /home/customer/www/wplearninglab.com/public_html/wp-content/themes/buddyboss-theme-child/functions.php on line 108

Warning: Use of undefined constant WPBF_CHILD_VERSION - assumed 'WPBF_CHILD_VERSION' (this will throw an Error in a future version of PHP) in /home/customer/www/wplearninglab.com/public_html/wp-content/themes/buddyboss-theme-child/functions.php on line 108