How to Link Your Own Google App in Integration For Google Drive | CodeConfig Skip to Main Content

How to Link Your Google App with the Integration for Google Drive Plugin

The Integration for Google Drive WordPress plugin allows you to connect your site to Google Drive. By default, the plugin uses its own Google App for authentication. However, you may prefer to use your own Google Cloud app for greater control and to address organizational or security requirements.
This guide provides step-by-step instructions to create a Google Cloud project, configure OAuth credentials, and link your custom Google app with the plugin.

Note: Google Cloud projects start in testing mode for external apps. Google will revoke the OAuth tokens after 7 days if the app remains unverified in testing. To use your app beyond 7 days without reauthorization prompts, plan to submit it for verification to attain Production status. If you encounter any issues using your own app, you can always disable the “Own App” option in the plugin settings to revert to the plugin’s default app.

Step 1: Prepare the Plugin for a Custom Google App

Before creating your Google app, adjust the plugin settings to use a manual connection.
In your WordPress dashboard, navigate to Google Drive Plugin > Settings > Accounts.
In the “Connection Type” option, select Manual. The plugin will display input fields for
App Client ID, App Secret Key, and an Authorized Redirect URI.Integration For Google Drive manual-login

This redirect URI is a callback URL that Google will use after users authorize the app.
Copy the redirect URI shown (e.g., https://codeconfig.dev/wp-admin/?action=integration-google-drive-auth)
and save it — you’ll need it in your Google Cloud app configuration.

Step 2: Create a New Project in Google Cloud

Open the Google Cloud Console
and log in. Click the project selector dropdown, then click New Project.
Give it a name (e.g., “My Google Drive Integration”), leave organization blank if not applicable, and click Create.Integration For Google Drive Create a New Project in Google Cloud

Step 3: Enable the Google Drive API

With your new project selected, go to APIs & Services > Library.
Search for Google Drive API, click it, then click Enable.
This allows your app to interact with Google Drive.Integration For Google Drive Enable the Google Drive API

Step 4: Configure the OAuth Consent Screen

Navigate to APIs & Services > OAuth consent screen. Choose a User Type:
External for public or personal apps, Internal for organization-only apps.
Click Create, then fill out:

  • App name: Your app name (e.g., “My WP Google Drive Plugin”)
  • User support email and Developer contact email

Optional: Add logo and other branding. Click Save and Continue.Integration For Google Drive Configure the OAuth Consent Screen

Step 5: Add Scopes for Google Drive

Click Add or Remove Scopes. Filter for “Drive” and select the scope:
https://www.googleapis.com/auth/drive.
This grants full access to Drive files. Click Update, then Save and Continue.Integration For Google Drive Add Scopes for Google Drive

If using an External app and remaining in test mode, add your email in the
Test users section.
Integration For Google Drive Create OAuth Client ID Credentials

Step 6: Create OAuth Client ID Credentials

Go to APIs & Services > Credentials, click Create Credentials > OAuth client ID.
Choose:

  • Application type: Web application
  • Name: e.g., “WordPress Google Drive Client”
  • Authorized redirect URIs: Paste the URI from Step 1, e.g.,
    https://codeconfig.dev/wp-admin/?action=integration-google-drive-auth

Click Create to generate credentials.Integration For Google Drive Create OAuth Client ID Credentials

Step 7: Retrieve Your Client ID and Client Secret

After creating credentials, you’ll see a pop-up showing your Client ID and
Client Secret. Copy both. You can also view them later under the Credentials page.

Step 8: Enter Credentials into the WordPress Plugin

Return to Google Drive > Settings > Accounts in your WordPress admin.
In Manual mode, paste the Client ID and Client Secret into their respective fields.
Leave the Authorized Redirect URI unchanged.
Click Save Changes.Integration For Google Drive Retrieve Your Client ID and Client Secret

Step 9: Connect Your Google Account using the New App

Go to the Accounts section and click Add New Account.
A Google login window will open. Log in, review the consent screen, and allow access.
If in testing mode, click “Advanced” → “Continue”.
After connecting, your account will appear in the plugin dashboard.Integration For Google Drive onnect Your Google Account using the New App

Security Best Practices

  • Keep credentials secret: Never share your Client ID or Client Secret.
  • Use least privilege: Only use the scopes necessary for your use case.
  • Verification: Submit for Google verification to remove test mode limits and warnings.
  • Monitor activity: Regularly check your project’s API usage and revoke unused credentials.