Connecting Google Drive
This guide shows you how to connect your Google Drive account to Hera Backup so your backups upload directly to your Drive. Google requires you to create your own OAuth credentials in the Google Cloud Console: this keeps your Drive private to you and is a Google security requirement, not a Hera Backup limitation.
The setup has four parts: create a Google Cloud project, enable the Drive API, configure the Google Auth Platform (consent + scope), and create an OAuth client. You then paste the client details into Hera Backup and authorize.
Google's console wording is current as of 2026. If Google renames a menu, the path in parentheses (for example, Google Auth Platform) is the section to look for.
Before you start
- Google Drive is part of the free Hera Backup plugin. Hera Backup Pro is not required.
- A Google account with available Drive storage.
- Access to the Google Cloud Console (the free tier is enough): console.cloud.google.com.
- Keep two browser tabs open, one on the Google Cloud Console, one on your WordPress admin, because you copy a redirect URI between them.
Step 1: Create a Google Cloud project
- Go to console.cloud.google.com.
- In the top bar, click the project selector (it shows the current project name or "Select a project").
- Click New Project.
- Enter a Name (for example,
Hera Backup) and click Create. - When the project is created, use the project selector again to make sure the new project is the active one.
_Note: capture only the dialog; do not include the account email in the top-right corner._
Step 2: Enable the Google Drive API
- In the left menu, go to APIs & Services > Library.
- In the search box, type Google Drive API.
- Click the Google Drive API result.
- Click Enable. Wait for the page to confirm the API is enabled.
Step 3: Configure the Google Auth Platform (consent screen)
Before you can create credentials, Google requires you to register the app on the Google Auth Platform.
- In the left menu, go to Google Auth Platform > Branding.
- If you see Google Auth platform not configured yet, click Get Started. (If it is already configured, the settings live under Branding, Audience, and Data Access.)
- Under App Information, enter an App name (for example,
Hera Backup) and choose a User support email. Click Next. - Under Audience, select External (choose Internal only if you use Google Workspace and want organization-only access). Click Next.
- Under Contact Information, enter an email address for Google to notify you of changes. Click Next.
- Under Finish, review and accept the Google API Services: User Data Policy, then click Continue and Create.
- Add the Drive scope so the app can request the right permission:
a. Click Data Access, then Add or Remove Scopes. b. Add the scope https://www.googleapis.com/auth/drive.file, then click Update and Save.
The drive.file scope only lets Hera Backup see files it creates in your Drive: it cannot read the rest of your Drive.
- Publish the app: do not skip this. Click Audience, and under Publishing status click Publish app, then confirm.
Because drive.file is a narrow, non-sensitive scope, Google does not require app verification: publishing takes effect immediately with no review, and Hera Backup can still only touch files it creates.
⚠️ Why this matters: if you leave the app in Testing status, Google expires the connection's refresh token 7 days after you authorize, and Drive backups stop until you reconnect. Publishing to In production keeps the connection alive indefinitely. This is Google's documented behavior: a test-user authorization, and any refresh token it receives, expires seven days from consent (Google Cloud docs). _If you would rather keep the app in Testing and accept reconnecting every 7 days, instead add your Google account under Audience > Test users > Add users._
Step 4: Copy your redirect URI from Hera Backup
You need the plugin's redirect URI in the next step, so open it now.
- In WordPress, go to Hera Backup > Storages.
- Find the Google Drive card and click Connect (it reads Configure once the destination is connected).
- Below Client ID and Client secret, copy the read-only Authorized redirect URI (add to your Google Cloud OAuth client) field (click the field to select it). It looks like:
https://your-site.com/wp-admin/admin.php?page=hera_backup_storage&oauth_callback=1&driver=gdrive
_Note: this URI must match exactly in Step 5, or Google returns a
redirect_uri_mismatcherror._
Step 5: Create the OAuth client (credentials)
- Back in the Google Cloud Console, go to Google Auth Platform > Clients.
- Click Create Client.
- Set Application type to Web application.
- Enter a Name (this is only shown in the console, for example
Hera Backup Plugin). - Under Authorized redirect URIs, click Add URI and paste the redirect URI you copied in Step 4. Paste it exactly, with no trailing space.
- Click Create.
- A dialog shows your Client ID and Client secret. Copy both now.
_Note: for the Client ID / secret screenshot, redact both values before publishing: treat them like passwords._
Step 6: Enter credentials and authorize in Hera Backup
- Return to the Hera Backup > Storages > Google Drive form.
- Enter:
Client ID: from Step 5.
Client secret: from Step 5.
Backup location (folder path inside My Drive, e.g. Backups/my-site) (optional): a folder path, read from the top of My Drive, for exampleBackupsorBackups/example-com. Do not start it withMy Drive(see Where your backups are stored below). Hera Backup creates each folder in the path that it cannot find. Leave it empty to upload to the top of My Drive.
Folder ID (optional): the ID of a Drive folder. If set, it takes priority over the backup location.
Max backups to keep (0 = unlimited): counted per schedule. When a scheduled backup finishes, that schedule's older backups here beyond this number are deleted. Manual and imported backups, the recovery point and the backup last restored are never deleted automatically. See Storage Retention and Cleanup. - Click Save first. Hera Backup builds the Google sign-in address from the saved Client ID and completes the connection from your WordPress server with the saved Client secret, so both must be saved before you authorize. If they are not, authorization stops with an error asking you to save them first.
- Click Authorize with Google.
- A popup window opens. Sign in with the Google account that owns the Drive and grant permission. (If you kept the app in Testing status, sign in with the account you added as a test user.)
Finish within 15 minutes, and keep open the Hera Backup tab you clicked the button in: that tab completes the connection. An authorization that takes longer than 15 minutes is refused, and you start again. - After you approve, the popup closes, the settings page shows a success notice, and the form shows Connected. The connection is saved at this point: you do not need to click Save again.
Step 7: Test the connection
- Click Test connection.
- Hera Backup uses the saved connection to get a fresh access token from Google, then requests your Google Drive account details. No file is created during the test.
- A passing test shows Connection OK.
Where your backups are stored
Google Drive uploads go to the location you choose in the form:
- No backup location and no Folder ID: files upload to the top of My Drive.
- Backup location set (for example
Backups): Hera Backup finds or creates that folder path, starting from the top of My Drive, and uploads there. The path does not start withMy Drive: enteringMy Drive/Backupscreates a folder named "My Drive" inside My Drive. - Folder ID set: Hera Backup uploads into that folder (this takes priority over the backup location).
Each backup is one .hera file, uploaded directly into that folder.
Because the connection uses the drive.file scope, Hera Backup only sees folders and files it created itself. So:
- If you already made a folder with the same name in Drive yourself, Hera Backup does not see it and creates its own folder with that name.
- A Folder ID must be the ID of a folder Hera Backup created (for example, one it made for a backup location). A folder you created in Drive yourself cannot be used.
To keep several sites separate, give each site its own backup location, for example Backups/example-com and Backups/other-site-com:
My Drive
Backups
example-com
(example.com's .hera backup files)
other-site-com
(other-site.com's .hera backup files)
If you set a Folder ID, do not delete that folder in Drive: Hera Backup uses the ID to locate your backups.
What to expect
- Google Drive appears as a destination for manual backups and schedules once connected.
- Hera Backup builds each backup archive on your server first, then uploads it with Google's resumable upload. If the transfer is cut off or Google answers with a temporary error, Hera Backup asks Drive how much arrived and sends only the rest, up to four tries.
- Backups count against your Google account storage (personal accounts include 15 GB shared across Gmail, Drive, and Photos).
- Access renews automatically as long as the app's publishing status is In production (Step 3). You only need to re-authorize if you revoke the app's permission in your Google Account, or if you change the Client ID or secret. If the app is left in Testing status, Google expires the connection after 7 days and you must reconnect.
- Upload speed is usually limited by your server's outbound bandwidth, not by Google.