In my first article about WordPress, I’ll show you how to easily add a page to your WordPress site that allows your users to invite their Facebook friends to check out your website.
You’ll first need to have Facebook Connect up and running on your site. More on that later.
What I did was make a WordPress Theme Template that will display the Facebook Invitation screen, complete with a friend selection box. It automatically pulls your website name, URL, and description to populate the Facebook invitation fields.
The reason I made this a theme template instead of a plugin, is because plugins are generally slow. WordPress loads all the code for the plugin on each page, whether the code is needed or not. This takes up valuable memory. Plus, the plugin gets called every time a page load, further cuasing overhead. With a theme template, nothing is loaded until the specific page that needs it is accessed. Some other advantages of this method are: it will automatically show your invite friends link in your page navigation, it will show up in the search engines, and it will show up in your WordPress site search as well.
To use the theme template, simply upload the template file () to your theme directory, then create a new page in WordPress and select “Page – Facebook Invites” as the Template.
It should work just fine for standard themes that have a header, sidebar, and footer. You must already have a Facebook connect plugin working on your site, though.
The original plugin built by a programmer at Facebook is called WP-FacebookConnect. It allows your users to log in with Facebook and uses Facebook profile pictures automatically on comments. It also lets your users optionally post their site comments back to their Facebook profile.
The plugin that I’m using on this site is the Sociable.es Facebook Connect WordPress Plugin. It is more robust than the plugin above as it adds a nice widget to show recent visitors, your Facebook friends that use the site, and your friend’s site comments. I have further modified it to show the full Facebook stream (your home page or your friend’s wall) and to also show a full list of all your Facebook friends regardless of whether they use the site or not. I’ve reached out the original developer to see about rolling these enhancements into his plugin.
One thing to be careful of, though, with both of the above plugins: If you already have a large number of users, make sure they log in to your site first before connecting with Facebook or they will get a completely new user ID created on your site.
There are many other Facebook plugins for WordPress, so you might want to just search for some in the plugin directory. Please let us know if you find a particularly interesting one.
I’d like to thank Adam over at http://www.intafuse.com/ for asking me to help get this working on his site. It motivated me to build the theme template as the easiest way to handle this.
If you’d like to help me out, please just spread the word about my Facebook Applications and the XtremelySocial.com website. Or maybe you might be able to help me one day with some WordPress stuff. I’ve had people ask how they could donate money to help pay for my dedicated webserver, so I finally set up an easy way to donate with Paypal.
23 responses to “How To Allow Users To Invite Facebook Friends On Your WordPress Site”
Hello, this looks like it was a great solution to a problem I’ve been trying to solve for a long time! However, due to recent changes this month with FB’s FBML it no longer works.
Are you able to create an alternative solution at this time?
Facebook wants us to use a “send” button now, which is an option when displaying a “like” button. You have to key in specific friends names rather than paging through a list of profile pics, but it does work pretty well. I’ll be rolling that out on this site soon.
See here for the Facebook documentation on it https://developers.facebook.com/docs/reference/plugins/like/
I’m using this great plug-in on my site. Actually, task is user can post idea to our site and they can invite fb friends to voting on their idea. So I need data to be submitted when I click on ‘Send Invitation’ button. Please reply me is their any solution for this. Thanks.