WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Do I need to use the Simple Facebook Connect plugin? or can I just use some facebook api code? Any help appreciated.

The example i'm trying to replicate is the interface at lookbook.nu. Once you login with facebook, there is a nice page to invite your FB friends.

share|improve this question
+1 good Question. – kaiser Feb 15 '12 at 20:21
up vote 1 down vote accepted

An easy way would be to include the Facebook Javascript code:


Then use the default Facebook invite page.

        function facebookInvite(){
            var request = {
                message: 'my message',
                method: 'apprequests'
            FB.ui(request, function (data) {
                if (data.request_ids.length > 0) {
                    alert("Facebook invite successful.");

EDIT: Here are steps you can take to invite your facebook friends to your website.

  1. Create an application for your website in Facebook. http://developers.facebook.com/docs/guides/canvas/ . You will need to read up on forwarding a user to your main website instead of a facebook application page aka canvas page.
  2. While logged in to Facebook ( as the same user that created the Facebook app ) go to your website and hit the "invite facebook link". See http://developers.facebook.com/docs/guides/web/ for details. This will send out the invites. Your friends will see a Facebook notification inviting them to your application. In our case, the application and the website is pretty much the same thing.
  3. When your friend accepts the application an icon will appear in their profile page. When they click that icon it will take them to your website. If you configure your application correctly, it will take them to your website and not the Facebook canvas page.
  4. When they land on your page you need some logic which handles a user coming in from Facebook.


share|improve this answer
Question: How would you then create users that can login to the specific wordpress site? As far as I can say from your code above (never dealt with the FB API), it invites friends to facebook and not the WP site. – kaiser Feb 15 '12 at 20:21
I would want to invite people to the website, and not the facebook page. I'm assuming I'll need a facebook app just for the website. – dwenaus Feb 15 '12 at 20:34
@kaiser He would need to register his site as an "application" in facebook. This code will invite people to that application. – rexposadas Feb 15 '12 at 20:45
@DerykWenaus Yes, you'll need a facebook app for the website. – rexposadas Feb 15 '12 at 21:00
@DerykWenaus I would give Simple Facebook Connect first to see if it fits your needs. I didn't use it because my client at the time needed custom functionality with facebook connect so I had to roll with a wrapper. – rexposadas Feb 16 '12 at 11:28

Hi friend please find this link. Here is a running script of facebook invite friend api with step by step implementation..


share|improve this answer
Welcome at WPSE salman! When posting a link please provide some context about the content of the link so in case it goes offline the basic info is still available here. – kraftner Jun 11 '14 at 11:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.