Skip to content

Google Drive Integration

Automatically save a backup copy of every signed PDF to your Google Drive. WPsigner’s Google Drive integration uses a one-click OAuth connection — no API keys, no manual configuration, and no developer setup required.


Document Signed → PDF Finalized → Backup Uploaded to Google Drive → Audit Trail Logged

When a document is fully signed and completed, WPsigner automatically:

  1. Generates the final signed PDF
  2. Creates a folder called “WPsigner Signed Backups” in your Google Drive (first time only)
  3. Uploads the signed PDF to that folder
  4. Logs the backup to the document’s audit trail
FeatureDetails
ConnectionOne-click OAuth — no API keys needed
TriggerAutomatic backup when a document is completed
FolderWPsigner Signed Backups (created automatically)
File naming{Document Title}_{Date}.pdf
PrivacyFiles are private — only your Google account can access them
EncryptionOAuth tokens are encrypted using WordPress salts
Token refreshAccess tokens auto-refresh — no re-authentication needed

  • WPsigner v2.0.0 or later
  • A Google account (personal or Google Workspace)
  • WordPress admin access (the manage_options capability is required)

You can access the Google Drive settings in two ways:

Option A — From the Integrations page:

  1. Go to WPsigner → Integrations in your WordPress admin
  2. Find the Google Drive card under Cloud Storage
  3. Click Configure

Option B — From Settings:

  1. Go to WPsigner → Settings
  2. Click the Google Drive tab
  1. On the Google Drive settings page, you’ll see the “Connect with Google Drive” button
  2. Click the button — you will be redirected to Google’s authorization page
  3. Sign in to your Google account (or select one if you’re logged into multiple accounts)
  4. Review the permissions — WPsigner requests access to:
    • Create and manage files in Google Drive that WPsigner creates
    • View your email address (to display which account is connected)
  5. Click Allow to grant access
  6. You’ll be redirected back to your WordPress admin with a “Successfully connected!” confirmation message

After connecting, the settings page shows:

  • Green indicator: Connected to Google Drive
  • Email address: The Google account connected (e.g., you@gmail.com)
ItemValue
Backup FolderWPsigner Signed Backups
PrivacyFiles are private (only you can access)
Auto-backupPDFs are saved automatically after signing

Click the “Test Connection” button to verify everything works:

  1. WPsigner uploads a small test file to your Google Drive
  2. If successful, you’ll see a confirmation message: ”✓ Test file uploaded successfully”
  3. You can check your Google Drive → “WPsigner Signed Backups” folder to see the test file

Once connected, there’s nothing else to do. The integration works automatically:

  1. Create and send documents for signing as you normally would
  2. Signers complete the signing process
  3. When all signers have signed, the document status changes to Completed
  4. WPsigner automatically uploads the signed PDF to your Google Drive
  5. The upload is logged in the audit trail for compliance tracking
  1. Open Google Drive
  2. Navigate to “WPsigner Signed Backups” folder
  3. You’ll see all your signed PDFs organized by filename

Backup files follow this naming pattern:

{Document_Title}_{Date}.pdf

Examples:

  • Service_Agreement_2026-02-07.pdf
  • NDA_John_Smith_2026-02-07.pdf
  • Employment_Contract_2026-02-07.pdf

If you need to disconnect:

  1. Go to WPsigner → Integrations → Google Drive (or Settings → Google Drive tab)
  2. Click the “Disconnect” button
  3. Confirm the disconnection

After disconnecting:

  • No more backups will be uploaded to Google Drive
  • Existing backups in Google Drive are not deleted — they remain in your Drive
  • You can reconnect at any time by clicking “Connect with Google Drive” again

To switch Google accounts:

  1. Disconnect the current account
  2. Connect again — you’ll be prompted to choose a Google account
  3. Select the new account and authorize

Security LayerDescription
AES-256-CBC encryptionOAuth tokens are encrypted before storage
WordPress saltsEncryption keys derive from your wp-config.php salts
Random IVEach encryption uses a unique initialization vector
No credentials storedYour Google password is never stored — only OAuth tokens

WPsigner only requests the minimum necessary Google API scopes:

ScopePurpose
drive.fileCreate and manage files that WPsigner uploads (cannot access your other Drive files)
userinfo.emailDisplay which Google account is connected

WPsigner cannot read, modify, or delete any other files in your Google Drive. The drive.file scope only grants access to files that WPsigner itself has created.

  • Access tokens expire after 1 hour
  • WPsigner automatically refreshes tokens using the stored refresh token
  • This means you never need to re-authorize — the connection stays active
  • If a refresh fails, a transient error is logged but no data is lost

WPsigner provides WordPress hooks for developers who want to customize the Google Drive integration:

// Change the filename format for Google Drive backups
add_filter('wps_google_drive_filename', function($file_name, $document_id, $document) {
// Example: Include document ID in filename
return "WPS-{$document_id}_{$document->title}_" . wp_date('Y-m-d') . '.pdf';
}, 10, 3);
// Perform actions after a PDF is backed up to Google Drive
add_action('wps_google_drive_uploaded', function($document_id, $file_id, $file_name) {
// Example: Send a notification
error_log("Document #{$document_id} backed up to Google Drive: {$file_name}");
// Example: Store the Google Drive file ID in document meta
update_post_meta($document_id, '_gdrive_file_id', $file_id);
}, 10, 3);

IssueCauseSolution
”Connect with Google Drive” button doesn’t workAuthorization URL not generatedRefresh the page and try again
Redirect after authorization failsCallback URL blockedEnsure your site is accessible publicly (Google needs to redirect back)
Test upload failsOutgoing HTTP requests blockedContact your hosting provider to allow requests to googleapis.com
PDFs not appearing in Google DriveIntegration disconnected or tokens expiredCheck the connection in Settings → Google Drive
”Failed to decode OAuth tokens” errorCorrupted callback dataTry disconnecting and reconnecting
Backup folder not found in DriveFolder was manually deletedWPsigner will recreate it on the next upload

Every Google Drive backup is logged in the document’s audit trail:

  1. Go to WPsigner → Documents
  2. Open the completed document
  3. Check the Audit Trail section
  4. Look for the entry: “PDF backed up to Google Drive: {filename}”

If this entry is missing, the upload may have failed silently. Check your WordPress debug log for more details.

Enable WordPress debug logging to troubleshoot connection issues:

// In wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

Then check wp-content/debug.log for entries related to Google Drive.


Does it work with Google Workspace (G Suite)?

Section titled “Does it work with Google Workspace (G Suite)?”

Yes. The integration works with personal Google accounts and Google Workspace (formerly G Suite) accounts.

Does it count against my Google Drive storage?

Section titled “Does it count against my Google Drive storage?”

Yes. Uploaded PDFs count against your Google Drive storage quota. Signed PDFs are typically small (100 KB–2 MB each), so this is unlikely to be an issue.

The upload will fail, and an error will be logged. The signed PDF remains safely stored on your WordPress server. You can free up space in Google Drive and future uploads will resume automatically.

The folder is automatically set to “WPsigner Signed Backups”. Currently, the folder name cannot be changed through the UI, but developers can modify the behavior using WordPress filters.

Do older documents get backed up retroactively?

Section titled “Do older documents get backed up retroactively?”

No. Only documents completed after the integration is connected are backed up. If you need to backup older documents, you can download the signed PDFs manually and upload them to Google Drive.

Is the connection shared between WordPress users?

Section titled “Is the connection shared between WordPress users?”

Yes. The Google Drive connection is site-wide. All WordPress administrators share the same connection. Documents completed by any user will be backed up to the same Google Drive account.