Envira Gallery Blog

Digital Photography Tips, Tutorials and Resources

Connect Your Google Drive With WordPress

How to Connect Your Google Drive with WordPress Media Library

by Waseem Abbas on Mar 23, 2017

Share This Post!

Do you want to sync your Google Drive with WordPress? You may have photos or videos saved to Google Drive that you want to use on your site. Importing the media manually by downloading it from Google Drive and uploading to WordPress will waste much of your time. In this tutorial, we will share how to connect your Google Drive with WordPress Media Library, so you can directly import content from Google Drive to WordPress.

Since Google Drive offers 15 GB free cloud storage to all its users, you can utilize this space to save your media files and connect your Google Drive with WordPress.

Mobile operating systems like Andriod and iOS also allow you to upload photos from your phone to Google Drive automatically. That means you can upload photos from your phone and connect them to WordPress via Google Drive.

To connect your Google Drive with WordPress, you’ll need to follow these 9 steps:

  • Step 1. Install and activate External Media plugin
  • Step 2. Go to External Media settings to configure it
  • Step 3. Visit Google Developers Console to create a new project
  • Step 4. Create credentials to use the API
  • Step 5. Configure the consent screen to generate client ID
  • Step 6. Give a name to your new App and save it
  • Step 7. Create client ID and add details for your application
  • Step 8. Copy & paste the Client ID to your site
  • Step 9. Import the Google Drive Media files to WordPress

Ready to get started? Let’s go!

Step 1: Install and Activate External Media Plugin

First thing that you need to do is to install and activate External Media plugin to your WordPress site.

If you want to learn more about installation, then check out our guide on how to install a WordPress plugin.

Step 2: Go to External Media Settings to Enable it

Upon activating the plugin, you should go to Settings » External Media and click on Google Drive from the plugin’s menu.

Choose Google Drive

You need to check mark on Enable this plugin.

Enable This Plugin

After enabling, you can see that there are few fields below for Client ID and Application ID. To generate these IDs, you will need to go to the Google Developers Console.

Step 3: Visit Google Developers Console to Create a New Project

Simply visit Google Developers Console and click on the Continue button. Make sure that Create a project is selected in the dropdown.

Create Project

API is enabled and now you need to create the credentials.

Step 4: Create Credentials to Use the API

On this screen, you can go ahead and click on the Go to credentials button.

Go To Credentials

Next you need to create Client ID. There are multiple options to generate credentials. You’ll click on Client ID link.

Client ID

Step 5: Configure the Consent Screen to Generate Client ID

You’ll be redirected to a new page where you need to click on the Configure Consent Screen button.

Configure Consent

Step 6: Give a Name to Your New App and Save it

Now you should add a name in the Product name shown to users field. It will be the name of your app. The name won’t be displayed; it’s for your own internal reference.

App Name

Make sure to hit the Save button.

Step 7: Create Client ID and Add Details for Your Application

On the next page, you need to select Web Application as Application Type and give a name for client (you can choose any name of your choice)

Client Name

In the URL field, you should give the URL of your site, and you can get the Authorized Redirect URL from the bottom of the Settings » External Media » Google Drive.

Redirect URL

Once these URLs are added, simply click on the Create button.

Step 8: Copy & Paste the Client ID to Your Site

On creating, a popup will appear with the Client ID and client secret. You need to copy the Client ID from here.

Client ID

Now go back to Settings » External Media » Google Drive page from your WordPress admin to paste the Client ID.

Application ID

You need to copy the first set of numbers from the Client ID and paste them in the Application ID.

Next you should remove the check mark from Filter to get all the images from Google Drive to WordPress.

Filter Uncheck

Once you are done with these settings, make sure to hit the Save Changes button.

Step 9: Import the Google Drive Media Files to WordPress

You have connected Google Drive with your WordPress site. Go ahead and create a new page/post from Pages/Posts » Add New or edit an existing page/post.

Click on the Add Media button above the visual editor. A popup will open to insert media in the page/post. You’ll see a new option as Insert from Google Drive.

Insert From Google Drive

Once you click on the Insert from Google Drive button and allow the app to fetch photos, you’ll see another popup with your Google Drive media files.

Select File

You can select the photos and click on the Insert button.

Once imported, the images are saved in your WordPress media library. If you deactivate or delete the External Media plugin, it won’t effect the photos.

That’s all. We hope this tutorial has helped you to learn how to connect your Google Drive with WordPress media library. You may also want to check out our guide on how to import your photos from Dropbox to WordPress Gallery & learn about making money online with this amazing guide.

If you like this tutorial, then please follow us on Facebook and Twitter for more free WordPress guides.

Share This Post!


  1. Hi!
    Thanks for your useful tutorial! Whenever I try to add Google Drive files, an error occurs: invalid_client no registered login. I checked the client ID but could not find a problem. What did I do wrong?


    1. Hey Paresh, the basic WordPress settings like file size limit will remain same when you import images from external resources. 🙂

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.