Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Connect Google Drive to Your WordPress Media Library

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Are you wondering how to connect Google Drive to your WordPress media library?

After making this connection, you can access all your Google Drive images, photos, and files directly from the WordPress dashboard. This can save you time and effort and is also a great way to share files with other WordPress users without sharing your Google password.

In this article, we will show you how to easily connect Google Drive to your WordPress media library.

How to connect Google Drive to your WordPress media library

Why Connect Google Drive to Your WordPress Media Library?

Google Drive is one of the most popular free Google tools and is a great way to store and share all kinds of files, including images.

If you regularly upload images to Google Drive, then you can save time and effort by connecting your Google Drive account to the WordPress media library.

You can then access any image in your Google Drive account directly from the WordPress dashboard.

How to connect Google Drive to the WordPress media library

With this integration in place, you can add Google Drive images to any page or post with the click of a button.

Do you manage a multi-author WordPress blog or accept guest blogs?

If you share the WordPress dashboard with other people, then connecting Google Drive to WordPress allows you to share images and files without sharing your Google password.

This helps to keep your Google account safe and makes it easier to lock people out of your Google Drive when they no longer need access.

That said, let’s see how you can connect Google Drive to your WordPress media library.

How to Connect Google Drive to Your WordPress Media Library

The easiest way to connect Google Drive to WordPress is by using the JoomUnited WP Media Folder Cloud Addon Google Drive Integration.

This plugin and addon allow you to access Google Drive files from the WordPress media library. You can also create folders and organize the files inside your Google account.

Set Up the WP Media Folder Plugin

The first thing you need to do is install and activate the WP Media Folder plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you will see the setup wizard. To get started, click on the ‘Continue to environment check’ button.

How to check your WordPress environment

After a few moments, the WP Media Folder will show some information about your WordPress environment, such as its PHP version and extensions.

To carry on, click the ‘Continue’ button.

Connecting Google Drive to the WordPress media library

You can now choose whether to disable the gallery and lightbox features.

These features allow you to create, edit, and delete folders inside the WordPress media library, so we recommend leaving them enabled.

Configuring the WP Media Folder WordPress plugin

With that done, click on the ‘Continue’ button.

You will now see some extra features you may want to use. The default settings should work well for most WordPress websites, but you can enable the additional features using their toggles.

For example, if you are using a WordPress page builder, then you may want to enable the ‘WP Media Folder on frontend’ feature.

When you are happy with the settings, click on ‘Continue’.

Enabling extra features in a WordPress plugin

After a few moments, you will see the following message: ‘You have now completed the plugin quick configuration.’

When you are ready, click the ‘Go to Media Library’ button.

How to connect WordPress to your Google Drive

Install the WP Media Folder Cloud Addon

Next, you will need to install and activate the WP Media Folder Cloud addon. You can install this addon in the same way you install a WordPress plugin.

WP Media Folder has an automatic connector that allows you to link WordPress to Google Drive without creating a project in the Google Cloud Console. For that reason, we recommend using the automatic connector.

However, if you can’t use the connector, then we show you how to connect to Google Drive manually at the end of this guide.

To connect Google Drive to your WordPress media library, you need to go to Settings » General.

Connecting a website to your Google Drive account using a WordPress plugin

Here, scroll to the ‘Joomunited live updates’ section.

Then, click on ‘Link my Joomunited account.’

Connecting WordPress to your Joomunited account

In the popup that appears, type in the email and password for your JoomUnited account.

After that, simply click on ‘Log in’.

Connecting WordPress to a Google Drive using your JoomUnited account

Now, you are ready to connect Google Drive to your WordPress blog.

Simply go to Settings » WP Media Folder to get started.

Connecting a website to Google Drive

In the left-hand menu, select ‘Cloud’ and ‘Google Drive’.

Here, simply click on ‘Automatic’.

Connecting Google Drive to WordPress using an automatic connector

You can now go ahead and click on the ‘Connect Google Drive’ button.

How to Organize Your Google Drive Images

Now you are connected to Google Drive, you can access and organize your files directly in the WordPress dashboard.

Simply go to Media » Library and select the new Google Drive option in the left-hand menu.

Accessing Google Drive images in the WordPress dashboard

You can now browse through all the images in your Google Drive.

Additionally, you can filter and sort these images or show more file types using the row of buttons in the toolbar.

Filtering, organizing and sorting images in the WordPress media library

You can also create new folders to manage your images. Any changes you make in the WordPress dashboard will be synchronized to the connected Google Drive account automatically.

This way, users can organize and manage images even if they don’t have direct access to the connected Google account.

To start, you can create a new folder by clicking on the ‘Add New Folder’ button.

Creating Google Doc folders in the WordPress admin area

In the popup that appears, type in a name for the folder.

Then, just click on ‘Create’.

Creating an image folder in the WordPress dashboard

This creates a new folder under the Google Drive parent folder.

To add images to the folder, click on the ‘Add New’ button and then select a file from your local computer. This image will be added to both the WordPress media library and your Google Drive account.

Adding images to a new folder in the WordPress dashboard

If you have been running your WordPress website for a while, then you may already have lots of images in the media library. In this case, you can easily back up your WordPress content to Google Drive by uploading these files to your Google account.

To do this, simply select ‘Media Library’.

Moving files between WordPress and Google Drive

Then, find the image that you want to upload to Google Drive.

You can either drag and drop the image into the parent Google Drive folder or any sub-folder you have created.

Organizing your Google Docs using a WordPress plugin

Simply repeat these steps to organize the WordPress files in your media library.

Add Google Drive Images to Your WordPress Website

You can now easily add any Google Drive image to your WordPress pages and posts. To do this, simply add an Image block in the WordPress content editor and then click on the ‘Media Library’ button.

How to easily add Google Drive images to your WordPress pages and posts

In the WordPress media library, either select ‘Google Drive’ or choose any Google Drive folder.

You will now see all the media files that you can add.

Adding photos and image files to WordPress using a Google Drive plugin

Simply click on the file you want to use.

With that done, you can type in image alt text, add captions, and more in exactly the same way you add any image in WordPress.

Adding alt text, a description, caption, and more to images in WordPress

When you are ready, just click on the ‘Select’ button. WP Media Folder will now add the image to your WordPress page or post.

Manually Connect Google Drive to Your WordPress Media Library

If you don’t want to use WP Media Folder’s automatic connector, then you can connect to Google Drive manually in the Google Cloud Console.

Create a Google Cloud Project

To get started, head over to the Google Cloud Console. If this is your first time visiting the console, then you will need to accept the terms and conditions and choose whether you want to get email updates.

With that done, click on ‘Agree and Continue’.

Agreeing to the Google terms and conditions

This takes you to the Google Cloud Console.

You will need to create a new project, so click on ‘Select a project’.

Creating a new project in the Google dashboard

In the popup that appears, select ‘New Project’.

You can now type in a name for the project. This is just for your reference, so you can use anything you want.

On this screen, you can also add an optional organization and change the location where Google Cloud Console will create your project.

Entering the information for a new Google Drive project

When you are happy with the information you have entered, go ahead and click on ‘Create’.

Enable the Google Drive API

After that, select ‘Enabled APIs & Services’ from the left-hand menu and then click ‘Enable APIs and Services’.

Enabling Google APIs

This screen shows all the different APIs you can enable. For example, you can show the latest videos from your YouTube channel by enabling the YouTube Data API or add a Google Calendar in WordPress using the Calendar API.

To connect Google Drive to WordPress, scroll to the ‘Google Workspace’ section and click on ‘Google Drive API’.

Enabling the Google Drive API

This takes you to a screen where you can activate the key that WordPress will use to access your Google Drive.

Simply go ahead and click the ‘Enable’ button.

How to enable the Google Drive API

Create an OAuth 2.0 Client ID

With that done, open the menu by clicking the line icon in the top left corner.

Then, select ‘APIs & Services’, followed by ‘Credentials’.

Creating credentials for a Google Cloud Console project

Here, you need to click on ‘Create Credentials’.

In the dropdown menu, you must select ‘OAuth client ID’.

Creating an oAuth client for your WordPress website

On the next screen, click the ‘Configure Consent Screen’ button.

You can now choose whether to create an internal or external app. If you select ‘Internal’, then only G Suite users within your organization will be able to access the app. If you select ‘External’, then your app will be available to anyone with a Google account.

After making your decision, you can click on ‘Create’.

Creating an internal or external Google app

Now, you will need to type in some information about the Google app and add your business email address.

You will also need to type in the domain name where you plan to use the application.

Registering an app in the Google Cloud Console

After completing this form, click the ‘Save and Continue’ button.

You can now specify the content that the app will be able to access and the actions it can perform by adding scopes. To see all the different Google Drive scopes, just click on the ‘Add or remove scopes’ button.

Adding scopes to your Google project

To add a scope to your project, simply check its box.

Just be aware that Google will review any scopes that are marked sensitive.

Adding scopes and APIs to a Google Cloud Console project

After adding all the scopes you want to use, you need to click on ‘Update’.

To move to the next screen, click ‘Save and continue’.

Adding permissions to a Google project

At this point, you may want to enter some more information about your app, including how you plan to use the application.

This step is optional, but it may help Google to verify and approve your project more quickly.

Verifying your app in the Google Console

When you are ready to move on, just click the ‘Save and continue’ button. Google will now show a summary of all the information you have entered.

Next, open the menu by clicking on the line icon and then select ‘oAuth Consent Screen’.

Connecting Google Drive to a WordPress project

You will see that your app is currently in test mode.

To make it live, go ahead and click ‘Publish App’.

Publishing a Google application

The Google Cloud Console will now show some information about extra steps you will need to take in order to pass the verification process. These include adding a link to your privacy policy and adding your WordPress site to the Google Search Console.

After reading this information, just click on the ‘Confirm’ button.

Pushing a Google app to production

Add the Client ID and Client Secret to WordPress

With that done, you are ready to create the client ID and secret key.

In the left-hand menu, select ‘Credentials’.

Creating credentials in the Google Cloud platform

Then, click on ‘Create Credentials’.

In the dropdown that appears, you need to select ‘OAuth client ID’.

Creating a client ID and client secret for your WordPress blog or website

On the next screen, open the dropdown menu and select ‘Web application’.

You can now type in a name for your OAuth 2.0 client. This is just for your reference, so you can use anything you want.

Creating a Google web application

Next, scroll to the ‘Authorized JavaScript origins’ section.

In the field, type in your website’s domain name.

Adding a WordPress website as an authorized JavaScript origin

Under ‘Authorised redirect URIs,’ add the following URL, making sure to replace ‘https://your-domain.com’ with your own domain name:

https://your-domain.com/wp-admin/options-general.php?page=option-folder&task=wpmf&function=wpmf_authenticated

Adding your site as an authorized direct URL

With that done, scroll to the bottom of the screen and click on ‘Create’.

After a few moments, Google will show your client ID and client secret in a popup. You will need this information, so make a note of it somewhere safe.

Getting a client secret and client ID from the Google Cloud Console

You can also download the information as a JSON file.

To add the client ID and client secret to WordPress, go to Settings » WP Media Folder in the WordPress dashboard.

Adding a Google client ID and client secret to the WordPress dashboard

In the left-hand menu, select ‘Cloud’ followed by ‘Google Drive’.

Then, you need to select ‘Manual’.

Manually connecting a WordPress blog or website to your Google Drive account

With that done, simply paste the client ID and client secret into the ‘Google Client ID’ and ‘Google Client Secret’ fields.

Now, click on ‘Connect to Google Drive’.

Connecting to your Google Drive account using WP Media Folder

In the popup that appears, select the Google Drive account that you want to use.

You will now see some information about all the data the app will be able to access and the tasks it can perform. Simply check the box next to each permission the app is requesting.

Granting an app access to your Google Docs

Then, click on ‘Continue’.

Finally, click on the ‘Save Changes’ button.

Adding a client secret to your website or blog

You’ve now successfully connected Google Drive to your WordPress media library.

Bonus: Import Google Docs to WordPress

Apart from connecting Google Drive with your website, you can also import Google Docs into WordPress.

For example, if you accept guest posts on your website and a user submits a post on Google Docs, then you cannot directly copy and paste the content in the block editor.

If you do that, then you will get lots of unwanted HTML tags, and sometimes, you may even lose all the original formatting.

In that case, it is much easier to import the Google Docs file than to copy and paste the content into WordPress. To do this, you can use Grammarly, which is a popular grammar tool.

Simply create an account on the platform and then paste the Google Docs content into its editor.

Pasting a Google Doc into the Grammarly writing assistant

Once you do that, all the HTML tags will automatically be removed from the content. You can now copy and paste the blog post into the WordPress block editor where it will be displayed in proper formatting with no HTML tags.

For detailed instructions, please see our tutorial on how to easily import Google Docs to WordPress.

We hope this article helped you learn how to connect Google Drive to your WordPress media library. You may also want to see our guide on how to create automated workflows in WordPress or see our expert pick of the best analytics solutions for WordPress users.

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

31 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Mrteesurez says

    Whaooo, this is fantastic.
    Wordpress is promising with these types of exciting integration.
    If this is the case, that means it’s possible I host files like ebooks and audios on Google drive and serve it for downloads through WordPress ?

  3. Yinka says

    hi,

    please is there a way to Link media from hard drive on computer with wp site, instead of uploading it to media library… thanks

    • WPBeginner Support says

      We do not have a recommended method for that at the moment as that would require your computer to send the images to anyone trying to view them on your site and if your computer is ever turned off they would no longer be able to see images on your site until it is turned back on.

      Admin

  4. 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

  5. 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.

  6. 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

  7. 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?

  8. 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?

  9. 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!

  10. 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!

  11. 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.?

  12. 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.

  13. 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

  14. 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.

  15. Mayank says

    Found an error, unable to work.

    Uncaught TypeError: Cannot read property ‘add’ of undefined
    at Object. (external-media-view.js:23)

  16. 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?

    • 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.

  17. 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!

  18. Paresh Wadhwani says

    do the 2 mb file size limit applies while transfering files from google drive…..Please reply

  19. 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.

  20. 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?

  21. 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.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.