Updated 2 years ago

Last Updated December 3, 2019
Wouldn’t it be nice to have all your local images and their folder structures automatically copied to your WordPress web site? So all you have to do is save an image with a good name in the right folder and your HD, and software and automation takes care of the rest.
You don’t have to laboriously maintain galleries, upload new images as you get them (bang head on desk), recreate thumbnails, clear caches, any of that.
Oh, you can still USE dedicated gallery plugins for fairly static galleries that you know will never change or have to be updated. This solution is best for rapidly changing and updated galleries.
The challenge is that the gallery addon we will use, uses “My Drive,” syncs to your specified Google Drive folder, but it does NOT sync your Pictures “Computers” does, but that’s completely separate – a pure backup of your HD.

This is where this solution comes in.
Basically, the method here is simply having scripts regularly duplicate your image files in Pictures to your specified Google Drive folder on your HD. This local folder syncs regularly with Google’s Backup & Sync to “My Drive” on your cloud Google Drive.
Advantages: You don’t really have to ever update or maintain your gallery images on WordPress. This is huge.
You can also spend a lot of time tweaking your naming systems and folder structures on your HD and this system does the rest, on a schedule.
This also takes off the load from your site.
Disadvantages: The styling options and lightbox are pretty limited, and if you view a lot of galleries in a short amount of time you will quickly hit Google Drive’s image limit, which may be ameliorated by requesting a quoto increase at https://cloud.google.com/docs/quota.
Requirements:
-Google Drive account upgraded to enough space,
-Wordpress
-“Image and video gallery from Google Drive” plugin
Make sure your Google Drive account has enough space. You may have to upgrade. Luckily Images don’t take up a lot of space.
Set up Google Drive, and configure Backup & Sync to sync your specified local Google Drive folder to your “My Drive” on Google Drive’s cloud.
Obviously, when you create and edit the vbs and bat files below specify your particular folder structure.
Create a .bat file with the following code. Remove the :: commenting on line 3 if you’d like an audio notification, and obviously specify an audio file location:
:: Runs hourly & triggered by CopyPictures.vbs, which runs it silently :: No quotes needed around drive letters but be sure there is a \ :: powershell -c (New-Object Media.SoundPlayer 'B:\Music\Misc\Sound FX\Backup VBS Sounds\Backup Initiated.wav').PlaySync(); robocopy "C:\Users\Jeff\Pictures\Art" "C:\Users\Jeff\Google Drive\Pictures\Art" /mir robocopy "C:\Users\Jeff\Pictures\Comics" "C:\Users\Jeff\Google Drive\Pictures\Comics" /mir robocopy "C:\Users\Jeff\Pictures\Media" "C:\Users\Jeff\Google Drive\Pictures\Media" /mir
Create a .vbs file with the following code:
Set WshShell = CreateObject("WScript.Shell" ) WshShell.Run chr(34) & "C:\Bat\CopyPictures\CopyPictures.bat" & Chr(34), 0 Set WshShell = Nothing
The reason i run VBS to run the Bat file is that it runs quietly in the background without a popup.
Under Task Scheduler, schedule the .vbs code above to run on a set schedule. I set mine to run hourly forever,
Make sure you enable this under your antivirus/firewall software. Bats and vbs files tend to set off a lot of alarms.
I’d suggest putting all .bat and .vbs files into one folder on your SSD to make it easier to manage them and exclude them.
To get it going manually copy all the images you want synced from Pictures to your Google Drive folder. Automation will take care of the rest.
Now, download and install “Image and video gallery from Google Drive” plugin for WordPress. Follow their directions exactly. It’s kind of involved, with creating a project on Google developers pages but it’s exact and thorough.
FAQ
Why don’t you just use Google Photos?
You have either drunk the Google Photos Kool-Aid, or you haven’t. This solution is for those who haven’t.
Although I have ~30,000 images, I don’t use Google Photos because photos don’t really take up a lot of space. For me, and this method, my local HD folder structure is all-important, and although I could have Google Photos sync with it and use the Photonic plugin, I’m just going with this because it works and I’m lazy.
Also, my image content often doesn’t really fit neatly into Google’s AI algorithms. I prefer more personal hands-on control.
Also, Google Photos cuts images off at 15 megs.
You could use this method with Photonic and Google Photos, but I don’t believe you’d get the same amount of folder control. I may be wrong. It’s nice to know there is a different solution.
See also info on migrating out of Enhanced Media Library:
https://tranceam.org/about/wordpress-themes-and-plugins/
