So I wrote a WordPress plugin to display photos from a public album on Google Photos. You can also get it on Github. You can see the result below, or over there –>, on the right sidebar, near the bottom. That’s all it does, it goes and gets the latest photos from an album in Google Photos, then displays them as a grid in a widget or through a shortcode. Most of the time I spent and code I wrote is due to boilerplate and re-learning about plugins. I’ve written a couple of other plugins, but I don’t do it often enough to remember how each time.
But why doesn’t one already exist? WordPress is the most popular CMS, Google Photos is obviously heavily used, seems like there should be dozens of plugins, but there aren’t. Mostly it’s because Google is a mess. Google is on it’s third iteration of a photo platform: Picasa, Google+, and now Photos. They have three versions of a Picasa API, even though Picasa is no more, so none of the APIs work reliably. There is no Photos API. Some Photos content can end up in Google Drive, but not all of it, so the Google Drive API is not useful here. Also, any new album you create in Photos doesn’t get added to Picasa (because it doesn’t technically exist as a product anymore), and the only way to make an album in Photos “public”, is to turn “Sharing on”. All that does, though, is provide you with a “sharable link”, it doesn’t actually promote that album to some public space, it merely removes authentication restrictions on who can view the album.
Really, the Google Photos “API” is a disaster. Or go read through the Google Photos support forums. There’s a trail of carnage with people confused and angry.
So I hacked this plugin, without an API, to just scrape the Photos album page. I fully expect it to break in spectacular fashion, or for Google to just silently block access. But for now it works and you can go get it on Github if you want to use it.
And you know, I only wrote this Google Photos plugin because I was copying this plugin for Instagram, which is no longer supported. Even without that plugin dying, I have stopped using Instagram for various reasons like privacy and data collection and attention capitalism (what?). So I’m replacing Instagram with Google (haha, privacy, haha, data collection), and this WordPress plugin is one small brick in the wall of my garden.
[Update] Contrary to what I wrote above, there are a few existing WordPress plugins for displaying Google Photos. I’m not sure why I missed them before, or maybe they just didn’t meet my needs so I overlooked them. But I stand by my opinion that photos in the Google-sphere is a mess and that the APIs don’t do what you think they do. At any rate, give them a try if you’re interested.
I have been through multiple plugins the past few days to find a replacement for our previous plugin.
Yours finally does the job without additional effort to display the images – so THANK YOU!
Just a quick question, I have tried to add an a href to link the images to a different page instead of the image link. Any suggestions on how to change this?
Hey, sorry for the delayed reply and glad you find the plugin useful. Unfortunately, the album url is hard coded as the link for the images. It would take some re-writing of the plugin to do what you want. If you’re still interested, I’ll think about how to go about it.
Hi DV, thanks for the app, it works great.
My request would be random photo order (so different ones appear each page load).
If you’re keen I could donate via paypal for this kind of update. (I understand if Google changes API or whatever that you don’t have to fix the whole app)
All the best
Hi, that probably wouldn’t be too difficult, but it might have a caveat. The plugin only pulls in the photos available on the public Google Photos webpage, so the random photos would have to come from that set. I don’t know if Google loads the whole album initially on that page or not. If not, and if your album has a lot of photos, you might not ever see the older photos.
Hello, thank you for simple plugin. Try to make direct link to photo, not whole gallery. And please enable using fancybox. I made change in html function –
$html .= ‘‘;
Thank you
Michal
Can you please add lightbox feature ?