Do you want to connect Google Drive to your WordPress media library? Google Drive offers free cloud storage and many people use it to store their photos and documents. In this article, we will show you how to connect Google Drive to your WordPress media library.
Why Connect Google Drive to Your WordPress Media Library
Google Drive offers lots of free and cheap cloud storage to save your files. Many folks use Google Drive to store their photos and share files with colleagues, friends, and family.
It also connects to Google Photos app which automatically backup all the photos on your mobile devices to your Google account.
If you run a photography blog, then connecting your Google Drive to WordPress media library will allow you to import photos stored on your drive and your phone.
Let’s take a look at how to easily connect Google Drive to your WordPress media library.
Connect Google Drive to WordPress Media Library
First thing you need to do is install and activate the External Media plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Upon activation, you need to visit Settings » External Media page to configure plugin settings.
External Media plugin allows you to connect to several external storage services. We will show you how to connect to Google Drive, but you can explore other services as well if you want.
Click on the Google Drive tab and then check the box next to ‘Eanble this plugin’ option.
You will be asked to enter a client and application IDs which we will can get by creating a project on Google Developers website.
Head over to Google Developers Console website and create a new project.
Developer console will enable the Google Picker API after creating the project. You will be asked to create credentials.
Click on the ‘Go to credentials’ button to continue.
On the next screen, you will be able to generate different credentials. We want Client ID, so you will need to click on Client ID link.
You will now see a screen informing you that you need to configure the consent screen before you can generate client ID. Click on configure consent screen button to continue.
On the next screen, you need to provide a name for your app and click on the save button.
This will bring you to the next step.
First you need to select ‘Web Application’ as your application type. After that provide a name for the client this could be anything you want.
You will also need to enter the URL of your WordPress site and the oAuth Callback URL. You can get the call back URL from plugin’s settings page at the bottom. It will look like this:
http://www.example.com/index.php?external_media_plugin=GooglePickerAPI
After entering this information, click on the create button to continue.
This will bring up a popup with your client ID, you need to copy and paste it in plugin’s settings page on your WordPress site.
The second key required by the plugin is the application ID. Your Application ID is the first set of numbers in the client ID. Copy the numbers before the dash and paste them in the application ID field.
You should now review the other plugin settings to meet your needs. Make sure that you uncheck the ‘Filter’ check box otherwise you will only see files starred in your Google Drive.
Don’t forget to click on the save changes button to store your settings.
You have successfully connected your WordPress site to Google Drive.
You can now head over to create a new post or edit an existing one. On the post editor screen click on the ‘Add Media’ button to launch the media uploader.
You will see an ‘Import from Google Drive’ button on the upload tab.
Clicking on it will launch the Google Picker popup allowing you to browse your Google Drive files and folders.
You just need to click on the files you want to import to select them and then click on ‘Select’ button.
External Media plugin will now import those files and store them into your WordPress media library.
You can now add the files to your WordPress posts and pages.
If you run a multi-user WordPress site, then other users will be able to import files from their own Google Drive as well.
The files are imported into your WordPress media library, so deactivating the plugin in the future will not affect the files already imported.
We hope this article helped you connect Google Drive to your WordPress media library. You may also want to see our list of 19+ free Google tools every WordPress blogger should use.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
sashi hari sulochan says
i am using this plugin to embed videos in my wordpress website, how to hide the poput option of google drive
WPBeginner Support says
For customizing the plugin, you would want to reach out to the plugin’s support and they should be able to assist you
Admin
Ted Keith says
I get all the way through this and have the import from google button. Click on the button and sign in with google. Nothing happens, Just goes right back to the import from google button screen. Sigh… wish stuff just worked sometimes. That’s an hour wasted.
Gabriel says
Same as below. I can import photos from Google Drive but it doesn’t upload properly, it shows a grey box. Images are not imported. What should I change? Thanks for your support
derred beh says
after following the steps, I can import photos from Google Drive,
but the file size is just 962B, and when try to view them, I just see a black page, with the square box in it.
Looks like the images are not properly imported?
How to fix this?
Giwa says
my clients newly design WordPress e-commerce site and he is selling eBook. can he use google drive as storage where the buyer can download the eBook after payment?
thisisyeeseul says
I am using it but it’s still using WordPress storage.
i wonder, is it possible to use it without storing wordpress?
plz let me know! thanks!
Stephanie says
I just tried to install the plugin and it crashed my entire site. Anything I click on gives me this error.
Parse error: syntax error, unexpected in /home/content/02/14034602/html/wp-content/plugins/external-media/plugins/Box.php on line 75
This error is the only thing showing on my site to the public right now.
HELP!
WPBeginner Support says
Hi Stephanie,
Please uninstall the plugin. Here is how to deactivate plugins when not able to access WordPress admin area.
Admin
Kerry says
Hi TARIQ, CAn you help me?
On the AOath consent screen..there is a place to click on your Gmail account …my husband’s keeps coming up and it’s not giving me any way to put in my address. This occurs right before “product name shown to users”. How will it know to access my Gmail account/photos.?
Courtney says
This is not working. I uploaded the plugin and had to do a very complicated Developer setup on Google and WordPress setup. But it is does not do what I need. I need to be able to upload the photos out of my Google Photos into my WordPress.org site, period. This does not display all my updated photos and instead has my documents from years back. The few photos it does show import in as a Google code instead of a picture.
Please develop a simple Google Photos upload plug-in instead of this.
Arsyila Maulidia says
Yes, nice info, i just apply on my web and succsesfully connect to google drive,
I’m arsyila
Great from Indonesia
Succses for wpbeginner
Tariq says
Question,
Is this method will fit Google SEO requirements? I dont think so and this will reduce our score. (If it will work)
The correct way using google drive with ANY website is to have G-Suit account and point an Google website (Only available in G-Suite since last Aug, 31 2017) as a sub domain in your website. This way you will increase your score by hosting static content in CDN.
Good luck.
J. Nijhuis says
This is not a CDN, it;s just an addon for directly browsing Google Drive images from within WP. The files are imported into your WP media library just like any other image you upload.
Mayank says
Found an error, unable to work.
Uncaught TypeError: Cannot read property ‘add’ of undefined
at Object. (external-media-view.js:23)
Abdulaziz Alnasi says
as you know that google offers Google photos service for free with unlimited storage, so what I think about is to store my images into google photos instead of having them on my host.
since I have shared hosting this method will decrease the load on my server.
so the question is: is (Google Drive) way will allow me to store my images into Google photos instead of google drive?
sachin says
Google not giving permission for uplkoading iamges from drive
Tariq says
No, Google give permission to host your image and call it from Google drive folder inside your website but ONLY if you are G-Suit member.
Virgo says
With the plugin version 1.10.14 the callback url is changed from
example.com/index.php?external_media_plugin=GooglePickerAPI
to
example.com/index.php?external_media_plugin=GoogleDrive
And in the Google API Console you need to enable the Google Drive APi too!
Paresh Wadhwani says
do the 2 mb file size limit applies while transfering files from google drive…..Please reply
galodu says
Great plugin. Thanks a lot for through instructions. Everything is in place. Only issue I am facing is that the images are not properly imported to media library. Images are corrupted. Please let me know how to solve the issue.
Orestis Rovakis says
That’s very informational and i will use it soon. But what brought me here waas the search for a way to transfer all my media filew to Google Drive so i can save space from my server. Does anyone know anyway to do that?
Dinil Abeygunawardane says
This is great, but this imports files to WP!
Is there a way to display images on WP without importing them?
Tony says
I totally agree. This is what brought me here too. A way to display images from a cloud storage service such as Dropbox or Google Drive without storing them into WordPress Media Library!
This would be totally useful. What about CDN’s, do they do that?
vikash says
hi Tony
Do Know that how is it possible? please tell me in detail i really need this for my website. thank you
Tariq says
This already Google drive offer it exactly in the way you ask but you need to be Google Suit member for 5$/m and they are giving you a real big benefit for this money, not only G-Drive, but much much more.