# Google Drive integration

FileBird Cloud has expanded its functionality by integrating with Google Drive, allowing users to effortlessly manage both local and cloud-based files from within the WordPress dashboard.&#x20;

This powerful integration simplifies media organization, enabling seamless access, syncing, and control of Google Drive files alongside your existing WordPress media library, all in one convenient platform.

To integrate FileBird Cloud with Google Drive, you will typically need the following plugins:

* [FileBird](https://ninjateam.org/wordpress-media-library-folders/)&#x20;
* [FileBird Cloud](https://ninjateam.org/downloads/filebird-cloud-integration-dropbox-and-google-drive/)

### How It Works

**One-Way Direction**: The syncing process only updates your WordPress media library with changes from Google Drive. Any changes made directly in WordPress, such as adding or deleting files, will not affect Google Drive. This ensures that Google Drive remains the master copy, with WordPress acting as a reflection of its current state.

**Folder Structure Preservation**: When you import folders from Google Drive into FileBird, the entire folder structure is preserved, making it easy to maintain organization.

**What Happens When You Sync:**

* **Additions:** Any new files or folders added to Google Drive since the last sync will appear in your WordPress media library.
* **Deletions:**  Importantly, if files or folders are deleted from Google Drive, they will **not** be automatically removed from the WordPress media library after the last sync. You must manually remove these items from WordPress if they are no longer needed.
* **Updates:** Any updates or changes made to existing files in Google Drive (such as renaming) will **not** be reflected in the WordPress media library after the next syncing.

### Step 1: Create a Google Cloud Project

To begin, open the web browser and navigate to <https://console.cloud.google.com/cloud-resource-manager>.&#x20;

Then, log in with your Google Account and click on the **Create Project** button at the top of the page.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FtbakZDfbuPNrvErkjWWE%2FGoogle%20Drive%20-%2027.png?alt=media&#x26;token=ddd4e500-8352-41f2-ac2e-6fdf86c3e37f" alt=""><figcaption></figcaption></figure>

Fill in the required details, including the **Project Name** where you’ll enter a name for your project, and the **Location** where you’ll choose an organization or location, if applicable.&#x20;

When finished, hit the **Create** button.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2Fv6Aq2p8bFvKgVgNRw9M3%2FGoogle%20Drive%20-%2031.png?alt=media&#x26;token=cdd9f264-1bb7-402b-ae43-59b7f84a5480" alt=""><figcaption></figcaption></figure>

You’ll receive a notification announcing the successful creation of your project. Once you see this, click the **Select Project** to start working with your new project.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FPZVUMNcppab06MmKPFd7%2FGoogle%20Drive%20-%2029.png?alt=media&#x26;token=7b38a7bd-7733-4ba8-8a41-493ad76ed3d4" alt=""><figcaption></figcaption></figure>

Click **Go to APIs overview** to proceed to the next step in setting up your project.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FYmtBWA0IxWajQ11a3SPX%2FGoogle%20Drive%20-%2014.png?alt=media&#x26;token=25bc3b65-adf7-41e5-9cdd-70cb206521d9" alt=""><figcaption></figcaption></figure>

Then, click **ENABLE APIS AND SERVICES.**

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2F9TiMlQsGWFOtgUUUKFMA%2FGoogle%20Drive%20-%2030.png?alt=media&#x26;token=a2d8e17b-0cde-4baf-82b3-903c4ce32368" alt=""><figcaption></figcaption></figure>

Here, type "Google Drive API" in the search bar and press **Enter**.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FgJMxFkPomTCPTliqnzkw%2FGoogle%20Drive%20-%2032.png?alt=media&#x26;token=6e718193-2847-4516-b1ee-deed2c100a96" alt=""><figcaption></figcaption></figure>

Waiting for the results to appear, select **Google Drive API** from the search results list.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FvOISfRf9kZfVrqAxk9Un%2FGoogle%20Drive%20-%209.png?alt=media&#x26;token=202f738b-36f9-4544-b5cc-70030c769aad" alt=""><figcaption></figcaption></figure>

After choosing it, click the **ENABLE** button to activate the Google Drive API for your project.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2Ffwtlpi0LdWsh06zZBstl%2FGoogle%20Drive%20-%201.png?alt=media&#x26;token=6bfb2307-af44-4317-93ad-7c1586f82574" alt=""><figcaption></figcaption></figure>

### Step 2: Create OAuth Credentials

Open the **Credentials** tab (1) > Click **CREATE CREDENTIALS** (2) > Choose **OAuth client ID** (3)

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FDnGtyKzik6VtrdxalL4f%2FGoogle%20Drive%20-%2010.png?alt=media&#x26;token=b00abcd7-0d41-43bb-b09f-8c5ebb544569" alt=""><figcaption></figcaption></figure>

Click **CONFIGURE CONSENT SCREEN** to continue.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FGuTOYHFz1TUEyrIEo1rB%2FGoogle%20Drive%20-%2024.png?alt=media&#x26;token=b224e64f-3123-414b-ab31-bf92ce5e8907" alt=""><figcaption></figcaption></figure>

Choose **External** for the user type and click the **CREATE** button.<br>

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FAmnc7nZ1KUGv2UXx24jr%2FGoogle%20Drive%20-%2021.png?alt=media&#x26;token=9dfd4ad5-d4cf-4b31-8bbb-3f95d04ec96a" alt=""><figcaption></figcaption></figure>

Now, you'll need to fill in several details for the **OAuth consent screen**.

1. **App information:**

* App name: The name of your application.
* User support email: An email address where users can reach out for support.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FpluApyjIf0d7gUlwj6UX%2FGoogle%20Drive%20-%2018.png?alt=media&#x26;token=3c7f43a5-fbd3-44f1-b407-c909740bc23a" alt=""><figcaption></figcaption></figure>

2. **Authorized domains:**

* Click **ADD DOMAIN** and enter your domain name.

3. **Developer contact information:**

* Enter an email address where users and Google can contact you regarding the app.

Once you've filled in these details, your OAuth consent screen will be set up and you can proceed to create by clicking **SAVE AND CONTINUE**.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FKu351py7c6etAQBfLuYz%2FGoogle%20Drive%20-%2017.png?alt=media&#x26;token=79915cb5-7f60-4aad-8954-ef0e0d6d96f5" alt=""><figcaption></figcaption></figure>

Let’s move on to the **Scopes** step, here you simply need to click the **SAVE AND CONTINUE** button.&#x20;

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FFfqhi9jZR3799lVacX6A%2FGoogle%20Drive%20-%208.png?alt=media&#x26;token=0b08d1f3-0fd4-44f7-ae8a-b791a059e703" alt=""><figcaption></figcaption></figure>

At **Test users**, you'll need to add users who will be able to test your application before it is fully published by following these steps:

Click **ADD USERS** (1) > Enter your email address (2) > Click **ADD** button (3)

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2Fn7uAlvyleyxY3iJtJG9j%2FGoogle%20Drive%20-%2013.png?alt=media&#x26;token=0aba253e-174c-4377-baef-53ed7a7ba9cf" alt=""><figcaption></figcaption></figure>

If you successfully add users, you will see your email address in the **User Information** section. This confirms that the email addresses you added have been correctly configured for testing purposes.&#x20;

Don't forget to save by hitting the **SAVE AND CONTINUE** button.&#x20;

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FNO5uYusJYSGkfzUjCzVF%2FGoogle%20Drive%20-%2020.png?alt=media&#x26;token=52e716a1-f9bd-4580-a8ff-1511877881e3" alt=""><figcaption></figcaption></figure>

The final step is here. In the **Summary**, you just need to check and review all the details you've entered for the OAuth consent screen, including app information, scopes, and test users.&#x20;

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FzItgzAuejvzLC3R8kl9v%2FGoogle%20Drive%20-%2011.png?alt=media&#x26;token=49b9e649-df37-4aff-abf7-2567577cc005" alt=""><figcaption></figcaption></figure>

Click **BACK TO DASHBOARD** to complete the setup.&#x20;

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FibK7BpupYuRlHguBbGKz%2FGoogle%20Drive%20-%2026.png?alt=media&#x26;token=fe534ad4-c740-48d7-b716-5b70abc51fc7" alt=""><figcaption></figcaption></figure>

### Step 3: Configure FileBird with Google Drive

Open the **Credentials** tab (1) > Click **CREATE CREDENTIALS** (2) > Choose **OAuth client ID** (3)

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FDnGtyKzik6VtrdxalL4f%2FGoogle%20Drive%20-%2010.png?alt=media&#x26;token=b00abcd7-0d41-43bb-b09f-8c5ebb544569" alt=""><figcaption></figcaption></figure>

Back to your site. Make sure you’ve downloaded and installed the **FileBird Cloud** plugin, go to **FileBird > Cloud.**

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FX5x4OJAseUsOOX5tjYm0%2FGoogle%20Drive%20-%2025.png?alt=media&#x26;token=7a26c4ac-fb0a-493c-af31-92bd069d7e62" alt=""><figcaption></figcaption></figure>

Choose the Google Drive tab, then copy the **JavaScript origins** and **Redirect URIs.**&#x20;

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FmY3FT0LK8HK3feiBlqjK%2FGoogle%20Drive%20-%203.png?alt=media&#x26;token=8abb45e8-ea3b-4d97-a384-d4cd53318dcd" alt=""><figcaption></figcaption></figure>

Return to Google Cloud Console. In the **Credentials** tab (1), from the **Application type** dropdown menu, select **Web application** (2).&#x20;

Under the **Authorized JavaScript origins** section, click **ADD URI**. Paste the JavaScript origin URL you copied from FileBird Cloud into the field. (3)

Similarly, at **Authorized Redirect URIs**, click **ADD URI** and paste your redirect URIs. (4)

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2Fu02j28sLUie7ISj6Dkx5%2FGoogle%20Drive%20-%206.png?alt=media&#x26;token=f9b31c7d-bded-4e99-a61e-0f110e4ac9a3" alt=""><figcaption></figcaption></figure>

Your OAuth client has been successfully created.&#x20;

Copy the **Client ID** and **Client Secret** from **Google Cloud Console** and paste them into your **FileBird Cloud** settings.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FhdeRvFV3IhkzusTnc5kv%2FGoogle%20Drive%20-%2028.png?alt=media&#x26;token=9ae8cbd8-31da-49fe-a407-f41addeebba6" alt=""><figcaption></figcaption></figure>

In your wp-admin panel, paste the **Client ID** into the **Google Client ID** field and the **Client Secret** into the **Google Client Secret** field, respectively.

Click **Save Changes.**

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FS3CpLOor2BeGxyvaaPCE%2FGoogle%20Drive%20-%2023.png?alt=media&#x26;token=8fb154c1-4eda-47d8-ad1c-2ecf7c71622b" alt=""><figcaption></figcaption></figure>

### Step 4: Sync Google Drive with FileBird

Once you have completed the above steps, the **Connect** button will appear. Simply click on it to connect your Google Drive with FileBird Cloud.&#x20;

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FeJFsMJRhMCMNd6jfTSG0%2FGoogle%20Drive%20-%202.png?alt=media&#x26;token=af5bd1f2-3e41-4019-a311-a68a70e190c6" alt=""><figcaption></figcaption></figure>

Choose your email address, the one you entered in the Google Cloud Console.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FAjo4m4d9DC7nh5a0yuf9%2FGoogle%20Drive%20-%205.png?alt=media&#x26;token=4900bf8d-54d3-47c3-9a5d-548398678351" alt=""><figcaption></figcaption></figure>

Here, click **Continue** to proceed.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FbfegaQtNldCDQbGM1zPe%2FGoogle%20Drive%20-%2012.png?alt=media&#x26;token=db9f24a8-57ae-4fa7-abcd-a83636fd78b9" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FWsPOgSZgltNXKA3RrhgW%2FGoogle%20Drive%20-%204.png?alt=media&#x26;token=66bd3d67-3d2d-420c-924e-a9bf0085a088" alt=""><figcaption></figcaption></figure>

After that, the page will redirect you back to FileBird Cloud. It's almost done, you’re now connected to Google Drive.&#x20;

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FQbvyYVOxY52NX6WNwJLo%2FGoogle%20Drive%20-%2015.png?alt=media&#x26;token=41b2f7aa-c76b-4fc6-8ab7-48f034410026" alt=""><figcaption></figcaption></figure>

Please go to <https://drive.google.com/> and log in to your account to check the folder.

When the connection is successful, your folder will appear in Google Drive with the following syntax: **Name** (the name you gave the app) - **your site**.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FAuTBthUa2igPu6VwAaCi%2FGoogle%20Drive%20-%2022.png?alt=media&#x26;token=7f086af0-e523-4cc0-8786-56d4baf4afb4" alt=""><figcaption></figcaption></figure>

Now, let's create some child folders and upload images into them. 🙌

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2F546ztOQM0bJiwHy1kO2Q%2FGoogle%20Drive%20-%2019.png?alt=media&#x26;token=0e7ecc78-b513-49d7-9d9b-aa5dd9d054f3" alt=""><figcaption></figcaption></figure>

Return to the FileBird Cloud panel again. Click the **Resynchronize** button to synchronize your folders and images from Google Drive to the FileBird folder tree.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2F3lEuG9IQ8HOXrFpEaGl1%2FGoogle%20Drive%20-%207.png?alt=media&#x26;token=ea733626-1215-4447-8f6c-88b0197ff36b" alt=""><figcaption></figcaption></figure>

**Ta-da!** 🎉🎉🎉&#x20;

You've successfully connected to Google Drive and synchronized your folders and images with FileBird Cloud.

This is the result.&#x20;

Your Google Drive folder now appears in the FileBird folder tree, and you can manage your files seamlessly using bulk select and drag-and-drop features.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FGeuj0hKxbVvvPBIlQ3Vb%2FGoogle%20Drive%20-%2016.png?alt=media&#x26;token=c92029e4-5c13-4c68-a5e0-dab7bc683912" alt=""><figcaption></figcaption></figure>

This integration is ideal for users who regularly work with large amounts of media and require a seamless connection between their WordPress site and Google Drive, ensuring that media files are always up to date without manual uploads or downloads.

Happy Cloud-ing ☁️


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ninjateam.gitbook.io/filebird/addons/filebird-cloud/google-drive-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
