Aaron Harp

Fotobook – A WordPress Plugin to Import Facebook Photos

Fotobook LogoFotobook is a WordPress plugin that will link to your Facebook account and import all of your photo albums into a page on your WordPress installation. It makes use of Facebook's API so importing your photos is a breeze.


  • Interfaces with Facebook's API
  • Displays photo albums on a WordPress page
  • Import photos from mulitple Facebook accounts
  • Sidebar widgets for displaying random or recent photos & albums
  • Insert individual photos into posts/pages
  • Easy-to-use AJAX album management panel
  • Frontend validates as XHTML 1.0 Strict



Check out my photo gallery.

Help Out!

To be honest, this takes up a lot of time. I enjoy doing it, but some money for it here and there would be nice.
Here are a few ways you can help out (and encourage me to work on it more =) ):

First, you could sign up for a Dreamhost account and use the promo code Fotobook. This not only helps me out but also waives the $50 setup fee when you pay monthly (only $10.95/month). If you choose one of the other payment periods you'll get $25.00 off. I've hosted with them for a couple years and I've had no problems. They have all sorts of features (500gb storage, unlimited domains, PHP4&5) and, best of all, they have one-click WordPress installs and upgrades.

Make payments with PayPal - it's fast, free and secure!If you are satisfied with your hosting and want to help out, you can send some cash over PayPal.


  1. Download and unzip the most recent version of Fotobook
  2. Upload the entire fotobook folder to /your-wordpress-install-dir/wp-content/plugins/
  3. Login to your WP Admin panel, click Plugins, and activate Fotobook
  4. Go to Options and then click the Fotobook link. Follow the two steps for linking the plugin to your Facebook account.
  5. Now import your albums on the Manage / Fotobook page.
  6. That's it!

To upgrade simply replace the old Fotobook directory with the newest version. Re-import all of your albums to complete the upgrade.


Fotobook isn't working, what's wrong?
Before contacting me, make sure your host is running PHP 5. If not, contact their support to see if it can be changed or switch to a host that does have PHP 5.

How do I create a new style for Fotobook?
To create a new style, simply duplicate and rename one of the existing styles and modify the files.

My theme doesn't support widgets.  How do I add the Fotobook widgets manually?
Use the following template functions:

fb_photos_widget(count, mode, size)
fb_albums_widget(count, mode)

$count: number of photos/albums to display (default: 4)
$mode: method for selecting photos/albums to display.  Can either by random or recent
$size: size of square thumbnails (default: 80)


<?php fb_photos_widget(4, 'random', 80); ?>
<?php fb_albums_widget(5, 'recent'); ?>

I have the Lightbox style selected but the images pop up in another window.
The Lightbox plugin must be installed and activated.

Can this plugin import photos from Facebook groups or pages?
Not currently.


Submit any problems, questions, suggestions, or compliments through the WordPress Forums. Make sure your post has the tag "fotobook" otherwise I won't see it.  Become a fan of the Fotobook Application to be notified when updates are available.

Change History

2010.04.29 - v3.2.3

  • Upgraded to latest version of Colorbox to fix problems with the large image not displaying

2010.11.29 - v3.2.2

  • Fixed issue where new users weren't able to import albums due to changes in Facebook's API.
    NOTE: If the import process hasn't been working for you, you will need to remove your account and go through the authorization process again.
  • There is now a third step in the "Add Account" process for getting extended permissions.
  • Better error handling when the photo import fails

2010.05.11 - v3.2.1

  • Fixed bug where photo order in Facebook was ignored
  • Fotobook scripts and styles are only loaded on the album pages

2010.05.09 - v3.2

  • PHP 4 is no longer supported
  • Added a new Colorbox display style which works without any additional plugins
  • Fotobook plays better with other plugins using the Facebook API
  • Fixed a bug where album covers were sometimes broken
  • Fixed bug where clicking the widget thumbnails would occasionally go to the wrong photo
  • Fixed bug where the first photo would show twice in the Lightbox
  • Fixed issue when importing photos for users with more than 5,000 pictures
  • Fixed bug with inserting photos into a post/page
  • Converted all JavaScript to use jQuery instead of Prototype
  • Optimized DB structure to avoid future problems
  • Upgraded to latest version of the Facebook PHP Client (which kills support for PHP4)
  • Code cleanup and optimization

2010.01.07 - v3.1.8

  • Fixed a bug where some accounts weren't able to import albums. Props to Aaron Ibrahim for figuring this one out!

2009.10.26 - v3.1.7

  • Long photo captions are no longer truncated
  • Fixed bug which could cause some of the photos to not be imported
  • Fixed bug with Windows systems not creating the albums table. Manifested itself by acting like it imported the albums and then saying "There are no albums."

2009.02.15 - v3.1.6

  • Fixed bug where changes to album order were not saved
  • Fixed other small bugs

2008.11.20 - v3.1.5

  • Added cron script for automatically updating albums (see settings panel)
  • Readied Fotobook for WP 2.7
  • Fixed duplicate key bug when importing photos of multiple users (props Darrell)

2008.11.19 - v3.1.4

  • Fixed bug where album pages were showing 404 errors
  • Hopefully resolved some conflicts with WordBook
  • Error handling for empty albums
  • WP Ajax hook is now used for requests

2008.07.30 - v3.1.3

  • Widget can now be added manually to the sidebar.  See FAQ section
  • Added confirmation when user tries to leave manage page before applying permissions
  • Updated to latest version of Facebook platform
  • Fixed safe mode error
  • Fixed management display issue in Internet Explorer 7
  • Added debug info to the settings page

2008.07.04 - v3.1.1

  • Fixed error when user is not tagged in any photos
  • Fixed some display/formatting issues

2008.06.17 - v3.1

  • Fotobook now creates an album of photos that the user is tagged in
  • Added an option to hide albums from showing up where pages are listed in your theme
  • Password protected albums are now protected
  • Restyled the admin panels to look better with WP 2.5
  • Fixed problem with UTF8 encoding in photo captions
  • Fixed conflict with other plugins that tried to hide pages
  • Fixed wp_rewrite issue when importing albums
  • Fixed fatal exception in PHP 5 when the session key became invalid
  • Other small tweaks and fixes

2008.05.17 - v3.0.7

  • Disabled output buffering for albums because it was causing too many issues.

2008.04.29 - v3.0.6

  • Fixed fatal error on activation with some setups.

2008.04.12 - v3.0.5

  • Modified feature for inserting photos into posts to work with WP 2.5's new media library.
  • Really fixed fatal error bug when upgrading to version 3.
  • Photo gallery can now be a sub-page.
  • Improved error reporting.
  • Cleaned up the code.

2008.04.06 - v3.0.3

  • Disabled Wordbook actions when adding and deleting album pages to prevent Wordbook from re-instantiating the Facebook API class.
  • Fixed fatal 'Session key invalid or no longer valid' error when upgrading to version 3.

2008.03.20 - v3.0.2

  • Updated to the latest versions of the PHP4 & 5 Facebook API clients. Huge speed boost for photo imports with PHP5.

2008.03.20 - v3.0.1

  • Fixed bug where albums would be imported but it would still say "There are no albums."
  • Fixed issue with local scope of $table_prefix during plugin activation in WP2.5.

2008.03.15 - v3.0

  • Added support for linking to multiple Facebook accounts
  • Major improvements on the photos widget display. Thumbnails are now squares for clean display.
  • Photo widget links go to the actual photo.
  • Added module in the post/page upload iframe for inserting individual photos.
  • Ajaxified the management panel so that the user is more aware of what's going on. There is a progress bar while albums are being imported.
  • Streamlined the way that the albums are requested from Facebook resulting in far fewer requests.
  • Added "Embedded Width" option to fix overlapping problems with the embedded style on narrower themes.
  • Added stylesheet editor to options panel.
  • Removed the popup style because it's kinda old school.
  • Cleaned up the code a bit.

2007.09.03 - v2.1

  • Photos from hidden albums are no longer shown in sidebars. And hidden albums are no longer accessible by their permalink.
  • Hopefully fixed the escaped quotes problem.
  • It detects changed albums/photos a little better now.
  • Lightbox will go through all photos in an album, not just the current page.
  • Fixed the fatal error if the isterLogger class is already present on the server.
  • Sidebar thumbnails can be larger than 130px (uses full image instead of thumbnail).
  • Added "Remove All" button in the manage page to get rid of all albums and photos and start over (some people have had problems with partial imports).

2007.07.10 - v2.0.1

  • Fixed an array_slice backwards compatibility issue with pre PHP 5.0.2 servers

2007.07.09 - v2.0

  • Revamped to work with Facebook's API
  • Multiple display styles are now supported
  • Added widgets for displaying photos or albums in the sidebar
  • Got rid of all the messy cURL and regex stuff.

For version 1 info click here.

Comments (90) Trackbacks (232)
  1. Thanks for the dreamhost.com offer! I am going to forward that offer to my friends and clients if that’s okay with you :)

  2. I found what appears to be a bug (spent the better part of the afternoon tracking it down. In this case, there’s a photo that appears in the “Photos of you” album, and in another album. You’ve marked the “photos of you’ album not to be shown. When you use the widget and the photo appears in the widget, the permalink to the album is to the ‘photos of you’ album, and not the other album the photo is in.

    In the wp_photos table, the pid of the photo is listed twice. One of the aids is for the photo of you album, and the other is the desired album.

    fb_get_photo_link is called from fb_get_random_photos, and that in turn calls fb_get_photo with the pid of the desired photo.

    fb_get_photo then looks up the pid in the photos table and returns the row with the aid of the ‘photos of you’, because it is the first matching entry in the table.

    I inelegantly hacked around this problem by adding “AND `aid` [the aid of the photos of you album]” to the $query in fb_get_photo. I know there must be a better way of doing this by making sure the album is marked visible.

    And of course, this fix could break something else, but so far it seems to work for me.

  3. Hi Aaron, I’m seeking a way to include albums from fan pages (not my profile), haven’t found a hint on this page so far… Can you help? Thanks a lot in advance!

  4. Is it possible to modify this to pull photos from a Page?

  5. great app, but one question: can be thumbnail of photo larger than 130px? when i set for example 50px it works perfect. but higher numbers than 130 are not working – the thumbnail is still 130px width. thanks a lot…

  6. i am using 5gigs.net for a free blog hosting , fotobook does not connect
    gives an authorization error and error connecting to external servers .

    wordpres sversion 3.0.3
    fotobook 3.2.2

  7. I did some improvements on the plugin. Awesome plugin by the way.

  8. Hey Aaron,

    I recently updated my wordpress installation, theme and fotobook plugin. I just discovered now that for many albums it loads the album description and the number of photos, but when the album is opened it only shows the tittle. Do you have any idea what the problem is?

    I checked already:
    - Privacy settings of the albums
    - Reinstalled the plugin
    - Deleted the facebook account settings and entered everything again
    - Different theme

    • The problem was caused by a conflict with another plugin. Deactivated all other plugins and now all photo albums show up properly. Just have to activate the other plugins one by one now to see which one caused the malfunction.

  9. Ciao

    I am having an issue with lightbox. I have fotobook and lightbox installed and active but my photos open in a new window. I did install lightbox after fotobook was installed. I did delete fotobook and installed it back once I had lightbox installed but my photos still open in a new window.

  10. Hey Aaron…

    I need to call a gallery from FBK in a post, for example “New Post”. Exist any shortcode o something for that???

    I’can do it!!

  11. great plugin but it really needs to be able to be used on facebook pages
    for our club site, for example, we want to be able to display the photos from our fan page!

    in the least an explaination why it is not possible


  12. Is there a way to import galleries from a business facebook page instead of from a personal account? I need this for our churches youth website (who uses facebook heavily for keeping in contact with the kids). I’m having a really hard time finding a plugin that can help me do this! Any and all help or information would be greatly appreciated!

  13. I can’t seem to find an option for displaying photographs/albums from a facebook page (rather than a profile). Is this possible (yet) with fotobook?

  14. I’m trying to link the photo album from my organization’s page in facebook… how could I do this? because it only links my personal account albums.

  15. Hello Aaron.

    I would just like to know whether do you happen to have a Blogger version of this plug-in?

    Thank you in advance. Have a great day ahead! :)

  16. I just wanted to add another request for this plugin to support Fan/Group Pages. I had it working with a few easy hacks, but the upgrade to WP3.1 broke it :(

Leave a comment

WordPress Lightbox 2 by Zeo