GDrive to Post
WordPress plugin: Automatically sync Google Docs from a shared Drive folder into draft posts with clean HTML, images, and one-click publish links
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/mikehillmt/gdrive-to-post/archive/refs/heads/main.zipAutomatically sync Google Docs from a shared Drive folder into WordPress draft posts with clean HTML, images, and one-click publish links.
Description
GDrive to Post connects to a Google Drive folder via Service Account, automatically syncs Google Docs on a daily schedule, creates draft posts from each document, and emails a notification with one-click publish links.
Features
- Service Account Auth - Secure connection using Google Cloud Service Account JSON key
- Folder Browser - Browse and select your Google Drive source folder from the admin UI
- Auto Sync - Daily automatic sync via WP-Cron with manual "Sync Now" button
- Clean HTML - Converts Google Docs to clean WordPress HTML with headings, bold, italic, links, lists, images, and tables
- Image Import - Downloads images into the WordPress Media Library
- Duplicate Detection - Already-imported documents are automatically skipped
- Subfolder Support - Recursively scans subfolders up to 10 levels deep
- Email Notifications - Configurable email notifications with one-click publish links
- Admin Dashboard - Connection status, sync status, recent imports, and quick stats
- Import Log - Filterable, paginated history of all imports
Requirements
- PHP 7.4 or higher
- PHP OpenSSL extension
- Google Cloud Service Account with Drive API enabled
- Google Drive folder shared with the Service Account email
Installation
- Upload the
gdrive-to-postfolder to/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
- Go to GDrive to Post > Settings
- Upload your Google Cloud Service Account JSON key file
- Share your Google Drive folder with the Service Account email address
- Browse and select the source folder
- Configure sync frequency and notification settings
- Click "Sync Now" or wait for the scheduled sync
Frequently Asked Questions
How do I create a Service Account?
- Go to the Google Cloud Console (console.cloud.google.com)
- Create a new project or select an existing one
- Enable the Google Drive API
- Go to IAM & Admin > Service Accounts
- Create a new Service Account
- Create and download a JSON key
How do I share a folder with the Service Account?
Right-click the folder in Google Drive, click "Share", and add the Service Account email address (found in the JSON key file as client_email).
Will it re-import documents that have been updated?
No. Once a document is imported, it will not be re-imported even if the source document is modified. Only new documents are imported.
What happens if I delete the WordPress post?
The import record remains in the log, so the document will not be re-imported. You would need to manually re-import it.
Can I change the post status from draft?
Yes. In Settings, you can set the default post status to Draft, Pending Review, or Private.
Changelog
1.0.0
- Initial release
- Service Account authentication with JWT
- Google Drive folder browsing and selection
- Automatic and manual sync
- HTML cleaning and image import
- Email notifications with one-click publish links
- Admin dashboard and import log