Recently at work a bunch of clients have requested to put their company’s Facebook page feed on their web site. Normally, I try to avoid doing this because for one, it’s tricky, and two, you want to use social media to drive traffic to your site, not to your Facebook page. Well, despite what I want, we have to do what the client wants.
As I mentioned, doing this is tricky. Facebook likes to change their feeds around all the time, and they don’t make it easy for you to find. Instead, I had to do some major digging. There are two things that come into play when finding your page’s RSS feed: the url and the ID.
To get the ID of any Facebook Page, go to graph.facebook.com and replace Digital Inspiration in the URL with the username of any Facebook Page. Also, Facebook does not offer RSS feeds for individual profiles.
By doing this it will give you a bunch of information about your Facebook page, which will include the ID.
Then you can plug it into this url:
The last thing you have to do is grab this code:
< ?php include_once(ABSPATH . WPINC . '/rss.php'); wp_rss('http://www.facebook.com/feeds/page.php?format=rss20&id=YourFacebookIDNumber', 3); ?>
Plug in your Facebook RSS feed url, place the code wherever your want your feed to show up, and then style to your liking. Super easy!
You can see examples of where I’ve used this method on two client sites:
- Facebook RSS Feed Tutorial
- A Directory of RSS Feeds of Popular Social Sites
- How to: Display any rss feed on your WordPress blog – WP Recipes
The above method for fetching a feed has recently been declared deprecated by WordPress. Instead, use the function fetch_feed. It’s a little more in depth, but it allows you to have a bit more control over how the feed is pulled.