How to Install Facebook Connect Comments on WordPress

facebook How to Install Facebook Connect Comments on WordPressFacebook has just introduced its first widget, the Facebook Comment box for Facebook Connect. Now, you can easily add the Facebook Comment system to your own site which offers a great opportunity for you to tap into the Facebook community as users have the option to make their comments appear in their news feed, potentially reaching thousands of people.

There are a number of other services online that offer advanced commenting such as Disqus and IntenseDebate (recently acquired by Automattic (the company the owns Wordpress)). I’ve recently contacted IntenseDebate and they’ve told me there are no current plans to support Facebook Connect. They do currently support OpenID, but I do think the opportunity to tap into the Facebook community is a significant advantage, enough so to ditch all the other services…if you consider the other services such as IntenseDebate, all you are really getting is gravatars, reply to comments, and the comments karma feature which no one really uses anyway.

Now, if you would like to easily get Facebook Connect set up on your WordPress blog, you can easily do it with these simple steps. Detailed instructions can be found at this Facebook Developer blog posting.

1.    Get your API key from the Facebook Developers site by creating a new Application.

2.    Download the cross-domain receiver file from Facebook and upload it preferably to the root of your site (http://yoursite.com/xd_receiver.htm)

3.    Open index.php with notepad or Dreamweaver from your Wordpress theme and add: xmlns:fb=http://www.facebook.com/2008/fbml for php you can add:

<?php
xmlns:fb=”http://www.facebook.com/2008/fbml”;
?>

4.    In single.php of your theme, or any other page you want the comments box to appear, insert this code in your theme:

<script src=
“http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php”
type=”text/javascript”></script>

<fb:comments></fb:comments>

<script type=”text/javascript”>
FB.init(”YOUR_API_KEY_HERE”, “<path from web root>/xd_receiver.htm”);
</script>

Remember, you must replace the YOUR_API_KEY_HERE with the one from the Application you created in http://developers.facebook.com

You will also want to remove your current comment template by deleting: <?php comments_template(); ?>

You must also replace the “path from web root” to your own so it finds the xd_receiver file

5.    That is all! You’re done!

Now, one major drawback over IntenseDebate is the comments made from Facebook Comments will not be stored in your Wordpress database, and existing comments will not appear either. Hopefully Facebook will make a special plugin for the millions of Wordpress bloggers for maximum adoption, especially as online web development isn’t an art most people are good at.

Update: I’ve removed FB Comment Box and replaced it with Disqus as it offers great comment management, and FB Connect out of the box. Sorry for the confusion! I would advise that you do not install FB Comment Box…as great as it is, there are many draw backs. For example, if typing a slightly long message, the textbox doesn’t get bigger so you can’t see what you are typing. It also requires annoying CAPTCHA. It doesn’t save comments on Wordpress either. You should install the Facebook Connect Wordpress plugin that allows you to keep comments on your own blog, send them to the Facebook news feed, and also adds a more social feel to your site OR even more simply, use Disqus as I do on here.


Tags: , , ,

Questions about this post? Please contact Hercules K at hercules@business2press.com

Short URL: http://bit.ly/N1zVI
  • I've removed Facebook Connect Comment Box, it was just too much of a headache. Sorry, all the comments have been deleted, but I've pasted them all here so they're not lost! And again, sorry for all the confusion.

    Hercules 2:56pm
    @ JAY, I just tried to post a reply on another post on here, and it seems the comments are based on only the certain post...

    There are still a lot of draw backs I think, for example, right now I can't see what I am typing because the textbox is too small and it hhasnt adjusted lol

    JAYat 2:43pm
    I'm curious if the comments are related to individual blog posts or are they considered one massive unit of comments.

    JAYat 2:42pm
    I'm curious how the comments are related, if at all, to specific posts. Or is is just one big glob of comments.
    Naveedat 1:55pm
    This is the first widget released by facebook, but will get popularity very soon, I hope.

    Johnat 12:18pm
    Anyone know why you would get a parse error when adding the php to both index.php and single.php?

    I can't get it to work.
    Adrian Toroat 11:34am
    Interesting... Facebook is moving forward with this connect thing.. ...this ´09 is going to be an interesting year for Social interaction on the web

    Ryan Williamsat 9:24am
    This is a test comment
  • craz
    Doesn't seem to work for me. Also want to let you know that your blog probably automatically reformatted the code, copying from here will not let it work properly
  • Hi Al,

    Is it still not working for you? Should be working if you do just as noted above. However, I would suggest you stick with Disqus, as it offers FB Connect, the new FB Comment Box is not very good as it won't store your comments on your database...it would be great if you could do that lol, but getting it to do that is beyond the scope of this post
  • Has anyone actually seen an implementation of the Facebook Widget in action. It's unbelievable how difficult Facebook makes it to use their tools. I'm largely concerned about how it effects the speed of my website. For example Disqus is great but my load time goes from 2sec to 8 secs when I add disqus. No good. Intense Debate rocks but lacks the neccessary FB connect. Big Big mistake by Intense debate. JS KIT is the ugliest thing I have ever seen and I want nothing to do with their widgets(although surprisingly speedy). I mean, unless you're a moron, you must have FB connect on your site. google friend connect is rubbish. No one use e-mail anymore. Well that actually depends on your target audience and mine is 18-30. Trust me, I can't stand Facebook. They've blocked me several times for using profanity, promoting drug use, talking about sex, bashing Zuckerburg or for adding too many friends(all of whom were actually my friends which is what kills me). They always let me back b/c they have too. I have way too many readers. Still, FB is a bloggers dream and a money making machine. Who cares if they're big brother? Society always has a way working such things out. Right now, they're making bloggers richer than richie rich. But where is this comment widget in action? Common Facebook. Solider up. I can't even get it to work. Ridiculous. Ridiculous
  • I take that back. Got the new Facebook widget to work on my site and it rocks. It's like lightening. Very simple and that's what I like about it. It almost forces a user to use facebook which I like too. Disqus and JSKIT are too confusing for the average person. Too many options is not always good. Even the design is nice, integrates well with my blog and yeah...is fast. Use facebook to build up your community. Not your website. Having all those users profiles on your site will just slow your site down and there is nothing worse than a slow site. I would say check out my site but it's undergoing a huge revamp and is password protected. If you really must see it an action, send an email to kingstonkobain@gmail.com and I'll hook you up with a special password.
  • But don't you want your comments to stay in your wordpress database? I mean, what if you no longer want to use Facebook Comment Box, if you disable it, all the comments will be gone forever...but I really love the fact it basically forces the user to use Facebook lol, just being realstic/honest :)
  • True, but the comments get stored on my Facebook page by integrating it with WPBook. I'm using wordpress in case you were wondering. People can comment through my facebook page and all those comments are directly loaded into my website. You make a good point though. I'm sure facebook will have a way to do this soon enough since they seem to be slowly taking over the web.

    ps. what's up with new disqus upgrade that's out today.? Anything special?
  • i agree with your updates. I have been trying to work with this shit on an iFrame based app, but getting a freaking error that says "Database Down" while posting anything!
  • woktherock
    masuuk
  • good article
  • thanks a lot, glad you liked it!
  • jaampool
    I thankful that I have found this place it is meaning to me.
  • I was curious about a proper solution to integrate FB connect as a commenting solution for my blog.
    Propably I will follow your advice and go for Disqus.
  • definitely you should go for disqus! it is the only comment system right now to also have social media reactions, including retweets, digg comments, etc.
  • Very nice explanation - I'm going to add this to http://www.Stuckincustoms.com
  • great :)
  • mrgjr
    How do you edit a comment made with facebook connect if it violates something on your site?
  • Unfortunately you can't edit comments like that, but if u use http://disqus.com (used on this site) then you can offer your readers to comment with Facebook effortlessly
  • Wow, nice tips, very easy understand, I have some works to do now.
    Thank for your share.
  • How awesome is this!
  • jacobopress
    prueba
  • Eric
    I have this setup, but I never get the pop-up asking me if I want to Publish to Facebook
  • Do you know how to setup facebook chat conenct plugin with wordpress?
    thnx
  • Facebook User
    Just trying this out, very slick - like it!
  • This is quite impressive, I am pleased to read this post, keep posts like this coming,

    you totally rock!
    Cheers
  • thank you for sharing this post
  • thanks rich, glad you like it. did you install it on your site?
  • thank you for sharing this post
  • Guest
    nice blog, I like it
  • Very helpful. Thank you!
  • Indeed it is Derek! I am impressed really.
  • The disqus comments box works way better. The only problem is that the comment box is located at the bottom of the comments.
  • Yes, putting the box at the bottom doesn't really encourage commenting.
  • Post as Facebook
  • Igor G
    Hi
    Is it possible to get user's encripted password ant store it on your own database?
  • This is awesome.
  • hmm let me try this.
  • thanks a lot for that marvelous post!!!
  • Test
  • This seems good. I have already enabled google friendconnect. can users post with google login?
  • Sorry - just a test
  • mizioblog
    good!
  • Is there anyway to force a visitor to log in with Facebook before they can comment?
  • Great! I was really looking for an integration such this. Thanks
blog comments powered by Disqus