Andy Tran

Connecting WordPress Media Library to Google Drive made easy!!

by | 21 Dec, 2021 | Wordpress | 0 comments

How to connect your WordPress media library to Google Drive

Why Connect Google Drive to Your WordPress Media Library?

Google Drive is one of the most usable cloud storage services that allows you to store your data online. It offers 15GB of free cloud storage to all Google account (personal accounts).

One use case for this could be you creating your online photo gallery site. If your site is in WordPress, you can directly access all your photos directly from Google Drive instead of uploading them to your WordPress. This drive can also be connected to your phone, hence you will have all your phone pictures at your disposal for your WordPress site.

Another use case could be for creating a Woo-Commerce site.  In this case, you can connect the drive for an easy list of images for category-wise uploads. This just adds to the overall convenience of using high-quality pictures easily.

This not just provides you with pictures easily at your disposal, whenever you need, but also helps with tackling a major data storage problem of maintaining all media on your WordPress instance. You can store all the images & documents on the Cloud Service like Google Drive, One Drive, URL, DropBox.

Now, We must connect your Google Drive to your WordPress media library, and we should be able to import the files to the WordPress website and use them in posts or pages, thus considerably reducing the loading time.

How to Connect Your WordPress Media Library to Google Drive?

External Media Plugin to rescue: Installation & Activation

You can search for the plugin by following the below steps or can click here for easy access:

    1. Go to the dashboard >Left Panel Plugins > Add NEW
    2. In Search Tab Enter External Media & Then install the plugin.
    3. Active the plugin for importing files from third-party services into WordPress Media Library (Dropbox, Box, OneDrive, Google Drive).

external media plugin installation and activation

    1. Go to the Dashboard > Settings > External Media > Choose the Google Drive option and click on the Enable this Plugin checkbox.

steps to enable installed plugin in settings

    1. Now, We should add the Client ID and Application ID.
      For this, go to Google Developers Console and create a new project and enable it’s API Key. You can also use your old API key, if you already have a project.

steps to add client ID and application ID through Google developer's console

    1. Here, we are choosing an old project i.e. WP Media – Google Drive.
    2. After successfully creating that, you get to see the dashboard.
    3. Then Go to Credentials > Create Credentials > OAuth Client ID.

Steps to find OAuth Client ID

    1. After selecting it, choose the web application as an application type and give an appropriate name.
    2. Followed by giving the URI for the website that you’d like to connect to Google drive. In our case, it is this.
    3. You will also have to create an authorized Redirect URL by going to External Media > choose Google Drive and Last Option Redirect URL.
    4. Copy the Redirect URL from WordPress and paste it on the console as an Authorized URI, followed by clicking on the CREATE Button.

copying the redirect URL from WordPress and paste it on console

    1. Once created, it displays Oauth 2.0 Client Ids and we can download it as a JSON file. This client Id and Application Id information will be added in the External Media Google Drive’s setting.

copying the JSON file and adding it to external media Google Drive setting

    1. Now go to the External Media > Google Drive and add that Client ID. The First 12 digits of your Client Id will become your Application Id and save the changes.

Saving the Client ID and Application ID in Google Drive

    1. You are almost there now. You can go to the Dashboard > Pages or Posts > Add New and click on the media to upload the files, and you will see the import from the Google Drive Option.

Importing from Google Drive option

  1. Clicking this button will ask you to log in to your Gmail/Google Drive account from where you can successfully import the files.

Thanks for reading our blog till the end. Are you in search of a top-tier IT consulting firm that focuses on salesforce consultancy, as well as providing services for mobile app development and web application development?  Contact us and learn more about our services.

Also Read: How to display logged in username on the top right of your wordpress website

Share this article...

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.