Andy Tran

Connecting WordPress Media Library to Google Drive made easy!!

by | Dec 21, 2021 | Wordpress

Why Connect Google Drive to Your WordPress Media Library?

Google Drive is one of the most usable cloud storage services that allow you to store your data online. It offers 15GB of free cloud storage to all Google account users(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 of 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 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 have to 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, and 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).
  4. Connect WordPress Media Library to Google Drive

  5. Go to the Dashboard > Settings > External Media > Choose the Google Drive option and click on the Enable this Plugin checkbox.
  6. Connect WordPress Media Library to Google Drive

  7. 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.
  8. Connect WordPress Media Library to Google Drive

  9. Here, we are choosing an old project i.e. WP Media – Google Drive.
  10. After successfully creating that, you get to see the dashboard.
  11. Then Go to Credentials > Create Credentials > OAuth Client ID.
  12. Connect WordPress Media Library to Google Drive

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

  18. 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.
  19. 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.
  20. 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.
  21. Connect WordPress Media Library to Google Drive

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

0 Comments

Submit a Comment

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