What Is Facebook Photo Fetcher (aka Social Photo Fetcher)?
Facebook Photo Fetcher (aka Social Photo Fetcher) is a Wordpress plugin that allows you to quickly and easily generate Wordpress photo galleries from Facebook albums.
The idea was inspired by Fotobook, though its approach is fundamentally different: while Fotobook's emphasis is on automation, this plugin allows a great deal more customization. With it you can create galleries in any Post or Page you like, right alongside your regular content. You do this simply by putting a "magic HTML tag" in the post's content - much like Wordpress Shortcode. Upon saving, the tag will instantly be populated with the Facebook album content. Presentation is fully customizable via parameters to the "magic tag" - you can choose to show only a subset of an album's photos, change the number of photos per column, show photo captions, and more. Plus, Facebook Photo Fetcher doesn't limit you to just your own albums: it can create galleries from pages as well.
- Uses Facebook's API to instantly create Wordpress photo galleries from Facebook albums.
- Galleries are fully customizable: you can import complete albums, select excerpts, random excerpts, album descriptions, photo captions, and more.
- Galleries can be organized however you like: in any post or page, alone or alongside your other content.
- Simple PHP template function allows programmers to manually embed albums in any template or widget.
- Built-in lightbox: Photos appear in attractive pop-up overlays without the need for any other plugins.
- Admin panel handles all setup for you: Just click "Login" and you're ready to start making albums.
- No custom database tables required; galleries live in regular post content.
The following box contains a sample gallery imported from Facebook using this plugin. It's generated by one single "HTML magic tag" placed in the content of this page:
- Download the latest version from here, unzip it, and upload the extracted files to your plugins directory.
- Activate the plugin via your Wordpress admin panel.
- Head over to Settings -> FB Photo Fetcher.
- Click the "Login with Facebook" link and follow the instructions. Once logged in, the page will automatically refresh and save the connection.
- Click the "Search for Albums" button under the "Utilities" tab; It will query Facebook and produce a list of your albums, each with an associated ID number. Let's use the example 1234567890123456789.
- Create a new post or page and enter the following tags, replacing the ID with the one you'd like to import:
<!--FBGallery2 1234567890123456789 --><!--/FBGallery2-->
IMPORTANT: You must use the HTML Editor (not Visual Editor) for the tags to be recognized. In Wordpress 5.0 (Gutenberg), this is now called the Code Editor, and is under the "3 dots" menu at the top right of the page.
- Click "Publish", and you're done! You can now view your new album.
Magic Tag Parameters
Let's start off with the basic code for importing a Facebook album into a page or post:
<!--FBGallery2 1234567890123456789 --><!--/FBGallery2-->
If you want a bit more control over how this presents the album, there are a number of parameters you can add to the opening tag, after the album ID number. These are:
- cols=#: Set the number of photos to show per row (default is 4).
- start=#: Start showing photos from the given index (i.e. to skip the first 2 photos, enter start=3)
- max=#: Limit the number of photos (i.e. to only show the first 5 photos in an album, enter max=5)
- rand=#: Show a random selection of photos from the album. This is applied after start & max, so to show 5 random photos from the entire album, enter rand=5; to randomize the first 5 items in the album, enter start=0 max=5 rand=5 (first limit the photos to the first 5, then randomize them).
- orderby=reverse: Flip the order of photos in the album (i.e. to show only the latest, you'd use "orderby=reverse max=1")
- hideHead=1: By default, albums will display their author, item count, and description prior to the first photo. Setting this will omit it that information.
- swapHead=1: Swap the order of the information in the header - author first, description second.
- hideCaps=1: By default, each photo shows an excerpt of its caption below it. Set this to omit them.
- noLB=1: By default, this plugin outputs the JS needed to setup the lightbox popups. Set this to omit it.
<!--FBGallery2 1234567890123456789 cols=4 max=16 --><!--/FBGallery2-->
Photos can also be imported from Facebook Pages: all you need to do is input a page ID in the admin panel's "Search" box to find its available albums. To get a page's ID, you can use findmybid.com - or if you're an admin, visit the page & click "About," and it should be listed at the bottom.
Albums from PHP
If you've got a custom template or widget in which you'd like to include a gallery, you can call the function fpf_fetch_album_content() directly. It accepts the same parameters as the HTML tags above; for example:
$album = fpf_fetch_album_content( '123456789', array('cols'=>6, 'max'=>18) ); echo $album['content']; echo "Cover photo: " . $album['cover'] . ", Photo Count: " . $album['count'];
Whenever a Facebook album is inserted into a post, that post will be given some additional metadata which you can reference from your own plugin or theme. At the moment, this metadata is:
- _fpf_album_size: The number of shown items in the album
- _fpf_album_cover: The URL of the album's cover photo on Facebook (if available).
Many hours have gone into making this plugin as versatile and easy to use as possible, far beyond my own personal needs. Although I offer it to you freely, please keep in mind that each hour spent extending and supporting it was an hour that could've also gone towards income-generating work. If you find it useful, a donation would be greatly appreciated.
FAQNote: Numbers may not be sequential as I remove old or outdated FAQs.
1. Magic Tag? Why not just call it shortcode!
I call it a "magic tag" because the way it works isn't quite the same as shortcode: Shortcode generates the content on-demand; that is, whenever a user loads a page, the shortcode will be processed and produce some html for them to view. The "magic tags" are processed when you save the page, downloading the album and inserting it as regular HTML. This avoids the need to connect to Facebook every time someone views a gallery, and also lets existing galleries continue to work even if the plugin is disabled.
5. When I save my gallery pages it says "Error 803: Your album id doesn't appear to exist."
Make sure there's a space after the ID in the start tag (i.e. <!--FBGallery2 12345 -->, not <!--FBGallery2 12345-->)
8. Albums are getting imported, but they always show as one huge column of photos.
This is a CSS issue. Most likely your theme isn't calling wp_head() in its header.php template, so Wordpress has no way to output the default stylesheet I've included.
9. I've got an idea for another feature. Could you implement it?
At the moment I'm no longer adding features to this plugin. This may change at some point, as I'd like to develop an expanded addon (similar to WP-FB-AutoConnect Premium). For now, here's a list of the most-requested features (which are not currently possible, but which I'm most likely to add once I find some time):
- Schedule cron jobs to automatically re-fetch all albums
- Get photos for groups and events
- Allow more than one "magic tag" per post/page
- Specify the photo size in popups (and/or include a link to the full-res photo in popups)
- Show Facebook comments, Like buttons, and tagged users in photo pop-ups
- Generate an "index page" for imported albums
- Pagination of albums
- Make sure you're using the HTML Editor, not the Visual Editor. In Wordpress 5.0, this has been renamed to Code Editor, and is under the "3 dots" menu at the top right of the page.
- If you're using Wordpress 5.0, there's a bug in their new editor that causes it not to properly reflect content that's been modified by plugins. All you need to do is refresh the page after saving - it will then show the content (or error messages) fetched by this plugin. Hopefully the Wordpress developers will fix the bug shortly.
- You probably have JS errors on your site which are causing the browser to abort before reaching the Lightbox code. Try using your browser's debugger to make sure you've fixed all other JS errors.
- The lightbox implementation I'm using had to be slightly fixed to support url "rel" attributes (required to html5 validate). If you have another plugin that includes its own lightbox, it could be replacing mine with an un-fixed version. Try deactivating your other plugins.
This is an issue with your theme's CSS. You'll need to edit your stylesheets and fix the z-indices so the lightboxed image comes up on top.
16. Is it possible to make a randomized album re-randomize its photos on every pageload?
If you create an album by calling the PHP functions directly (in a custom template), photos will be fetched and randomized each time the page is loaded. To achieve this behavior with magic tags (i.e. in your posts), you'll need to write your own filter to do so (try calling fpf_run_main() from a filter on "the_content"). However, as this will be very resource-intensive and will make your pageloads dependent on Facebook itself, I don't recommend it - a better idea would be to setup a cron job to re-fetch the album periodically (i.e. once an hour). This maybe added to a future version, but for now I'm afraid you're on your own.
20. Is there a way to create an "index page" that links to all my imported Facebook albums?
Sure, but it requires custom coding. You can implement this by creating a page template that iterates through and lists its child pages, then make your albums children of that page. For help, see the WP docs.
22. When I update an album on Facebook, it isn't reflected on my blog.
See FAQ1 for how this plugin works, and why it doesn't reconnect to Facebook on every pageload. To bring your galleries in sync with Facebook you may re-save them manually, or use the "Re-Fetch" buttons in the admin panel. If you want to make it automatic, you'll need to implement a cron job (FAQ16; FAQ9-a).
24. Is there a way to change the picture/thumbnail size?
Not at the moment, but you can always reduce the *apparent* size by scaling them down with CSS.
26. The image popups say "The requested content cannot be loaded," or the thumbnails don't display.
Facebook periodically changes their image URL scheme; my guess is that you're viewing an older album whose photos have since been moved. Re-fetching once should update & fix it.
28. Why does my Facebook authorization expire after 2 months?
In 2012, Facebook revoked the ability to allow non-expiring access tokens . Annoyingly, they also left no way to extend them without manual user interaction. I've therefore added a "Renew" link so you can extend them yourself. Note that an expired token will not affect your existing albums; it will only prevent you from importing new ones until you authorize again.
29. I'm getting the error "wp_remote_get() failed" when trying to setup the plugin or fetch an album.
This is due to a problem with your server's configuration; you'll need to contact your webhost to have them fix it. The most common cause is over-aggressive firewall settings, which block the plugin from contacting Facebook.
30. The "Login with Facebook" button isn't working.
This plugin originally used an iFrame to authorize with Facebook, but recent browser updates seem to have broken this method. Please update to plugin version 2.8 or greater, which has been rewritten to use a more compatible authorization method.
31. Why is this plugin called both Facebook Photo Fetcher and Social Photo Fetcher?
For the first nearly ten years of its life, this plugin was called Facebook Photo Fetcher. Then Facebook's oversensitive copyright lawyers decided that wasn't OK, and demanded I not use the word "Facebook" or "FB" in the name. Thus...Social Photo Fetcher.
100. Something else isn't working as you've described!
Improperly coded themes and conflicting plugins are two of the most common sources of error, so if you're confident you've followed the directions above and something still isn't working, please try it again with all other plugins disabled and with the default Wordpress theme. If that works, you should be able to pinpoint the source of the issue by reactivating them one at a time.
101. How can I get personalized help with this plugin?
As described in the "Feedback/Support" section below, I'm unfortunately no longer able to offer free one-on-one support for this free plugin. If I've explicitly directed you to this FAQ, it probably means you contacted me without first making a donation.
So, you've setup the plugin and it isn't doing what you expect. What now? The first thing you should do is carefully reread all the documentation above, paying special attention to the FAQs; 99% of support questions are solved by the solutions already offered above.
Still no joy? If you need personal help, you can get paid support by donating at least $20USD to the author:
You may then contact me directly via the button below. Again, please remember that I will no longer be replying to requests for free support. I'm sorry to do this (I avoided it for well over a year), but due to the overwhelming stream of questions (even after the plugin was deemed stable by many thousands of users), I can simply no longer afford to offer my time for free.
Download testking mcdba tutorials to learn about Wordpress. Our testking mcdst guide and testking mcp demos will provide complete information on WP plugins.