Adding Facebook widgets to WordPress (2018 edition)

Question from a blogger:

How do I embed a Facebook widget on my blog.ryerson.ca blog?

Answer:

We seem to be more limited in what we can embed without adding a special plugin to WordPress. There are two main ways that content can be embedded from Youtube, and unfortunately only one of them can be used on blog.ryerson.ca.

Using oEmbed (Yup! But it’s limited)

Many sites, like Facebook and Youtube, are oEmbed-enabled, making it easy to embed their content on other websites (like those running on WordPress).

Useful resources:

You can embed a single activity, a single video, a photo. The downside is that you cannot embed groups of things, like an activity feed, a gallery, or an overview of a page (among other things). Also, the entire profile needs to be open to the public for this to work.

https://www.facebook.com/GarbageOfficial/photos/a.696191563725031.1073741830.243166889027503/1847343175276525/?type=3&theater

Using Facebook code snippets (Nope!)

See this page: https://developers.facebook.com/docs/plugins

I think this used to be a doable thing, but Facebook changes their code and WordPress changes their code… and they don’t always move in the same direction.

Short answer – WordPress tends to code with security in mind, meaning that they don’t permit much of the code that you will find in ’embed’ codes from social media sites. I know this is disappointing, but it is absolutely necessary. Security is a major issue, and we need to keep our data and our systems protected. This also means that I’m not looking for loopholes to break through the security.

Only the WordPress multisite network Super Admins can add Facebook widget code 🙁

If anyone else tries to, it gets stripped to the point that it’s useless (if using a Text widget) OR there are errors that prevent you from saving the widget (if using the new Custom HTML widget)