🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

GravityExtra Drive Embed Setup Guide

Updated 13 min read WordPress Plugins Integrations A–Z
On this page
  1. What you need
  2. Install and activate
  3. Create your Google Cloud OAuth client, step by step
  4. 1. Create a project
  5. 2. Turn on the Google Drive API
  6. 3. Set up the consent screen
  7. 4. Add the permissions (scopes)
  8. 5. Create the OAuth client
  9. 6. Connect in WordPress
  10. Access levels and Google permissions
  11. The folder library
  12. Show a folder on a page
  13. File browser and search
  14. Previews of single files
  15. Galleries
  16. Download links
  17. Upload box
  18. Uploads and limits
  19. Link sharing
  20. Cache
  21. Privacy and security
  22. Without an active license
  23. Disconnect and uninstall
  24. How GravityExtra Drive Embed differs
  25. Troubleshooting

GravityExtra Drive Embed puts the Google Drive folders and files you choose on your WordPress pages. Visitors browse a folder with breadcrumbs, sort it, search inside it, preview Google Docs, Sheets and Slides, PDF files, videos, audio and images, page through galleries and download files. A front-end upload box sends files straight into a Drive folder. You decide for every folder who may see it. The plugin connects with your own Google Cloud OAuth client, keeps the Google access on your server and streams files through your site, so your Drive files can stay private. It is a standalone WordPress plugin: no Gravity Forms needed.

What you need

WordPress 6.5 or newer and PHP 7.4 or newer, with any theme (the plugin adds a block and a shortcode). A Google account with the files in Google Drive (a personal account or a Google Workspace account), and access to the Google Cloud console with the same or another Google account to create an OAuth client. Your site should use https; Google accepts http redirect addresses only for localhost.

Install and activate

  • Upload the plugin zip in Plugins → Add New → Upload Plugin and activate it. A new Drive Embed menu appears with Folders and Settings.
  • Go to Drive Embed → Settings → License, enter your GravityExtra license key and press Activate License. The key is shown masked once it is active.
  • Then create your Google Cloud OAuth client (next section) and connect on the Connection tab.

Create your Google Cloud OAuth client, step by step

The plugin talks to Google with an OAuth client that belongs to you. Nothing goes through a GravityExtra server, and you can remove the access at any time. Creating the client takes about ten minutes. Google renames menu items in its console from time to time; if a label below differs a little, look for the closest match.

1. Create a project

Open the Google Cloud console at console.cloud.google.com and sign in. Click the project picker at the top of the page and choose New project. Give it a name you will recognise, for example “Website Drive”, and press Create. Make sure the new project is selected in the picker before you continue.

2. Turn on the Google Drive API

Open APIs & Services → Library, search for Google Drive API, open it and press Enable. The plugin uses version 3 of this API for listings, previews, downloads, uploads and sharing.

Open Google Auth Platform (in older consoles: APIs & Services → OAuth consent screen) and press Get started.

  • App information: an app name such as “Northwind website” and your support e-mail address.
  • Audience: choose Internal if your Drive is in a Google Workspace organisation and only people of that organisation sign in: there is no review and the access does not run out. Choose External for a personal Google account.
  • Contact information: an e-mail address for messages from Google about the project.
  • Accept the user data policy and press Create.

With External, the app starts in the Testing state. Add the Google account that holds your files as a test user under Audience. Important: in the Testing state Google ends the access after seven days, and you would have to connect again every week. When everything works, press Publish app on the Audience page to move it to In production. Because only you sign in to this app, you can keep using it without Google’s app review; Google then shows a notice that it has not verified the app when you connect, and you continue with Advanced and Go to your app name. Google’s review rules can change, so read the notes on the Audience page.

4. Add the permissions (scopes)

Under Data access, press Add or remove scopes and add the scope of the access level you plan to use (see the table in the next section): .../auth/drive.readonly for View only, .../auth/drive.readonly and .../auth/drive.file for View and uploads, or .../auth/drive for Full access. Save. Google lists drive.readonly and drive as restricted scopes; drive.file is a narrower scope that covers only files the plugin creates.

5. Create the OAuth client

  • In WordPress, open Drive Embed → Settings → Connection and copy the Authorized redirect URI shown there (it ends with wp-admin/admin-post.php?action=gewde_oauth).
  • In the console, open Clients (or Credentials → Create credentials → OAuth client ID) and press Create client.
  • Application type: Web application. Name: anything, for example “WordPress”.
  • Under Authorized redirect URIs, press Add URI and paste the address from WordPress exactly as it is. No JavaScript origins are needed: the browser never talks to Google’s API.
  • Press Create. Google shows the Client ID and the Client secret. Copy both. Newer consoles show the secret only once, so keep it in your password manager.

6. Connect in WordPress

Back on the Connection tab, paste the client ID and the client secret, choose the access level and press Save Changes. The secret is stored encrypted and shown masked from now on; leave the field empty to keep it. Then press Connect with Google, sign in with the account that holds your files and allow the permission Google shows. You come back to the settings with the status Connected as and the account’s e-mail address, and the list of permissions that were granted.

The Connection tab of the Drive Embed settings: client ID, a masked client secret, the redirect URI to copy, the three access levels, and the status Connected as studio@northwind.example with the granted permission
Your own OAuth client, the access level and the connection status.

Access levels and Google permissions

The plugin asks Google only for what the features you use need. Choose the level on the Connection tab; after a change, press Reconnect so Google can ask for the new permission (the tab tells you when a permission is missing).

Access level Google scope What the plugin does with it
View only (default) drive.readonly Lists folders, reads file details, streams previews and downloads, exports Google Docs, Sheets and Slides as PDF. It cannot change anything in your Drive.
View and uploads drive.readonly + drive.file Everything above, plus creating upload folders and uploading files into folders the plugin created, and link sharing of those uploads. Other files stay read-only.
Full access drive Uploads into any folder of the library and link sharing of any file. Use it only when you need those two things.

The plugin never deletes Drive files. With View and uploads, use Create an upload folder on a library folder: the plugin creates the folder in your My Drive, and you can move it anywhere in your Drive later; uploads keep going there.

The folder library

Open Drive Embed → Folders and press Add folder. Each entry is one Google Drive folder your site may show:

  • Name: shown as the first item of the breadcrumbs.
  • Short name: used by the block and the shortcode, for example project-files.
  • Google Drive folder: paste the folder’s address from Google Drive (or its id). The plugin checks that the connected account can open it and stores its name.
  • Who can view: Everyone (also visitors who are not logged in), Any logged-in user, or chosen roles such as Editor or Subscriber. Everybody else sees nothing where the block is, and the file addresses answer “no access”. Staff with the Drive Embed capability always see the folder.
  • Views: file browser, gallery, search and download links, each on or off.
  • Uploads: off, logged-in users, only chosen roles, or everyone (with a warning), and the upload folder.
  • Link sharing for uploads: none (recommended) or anyone with the link for each uploaded file.

Visitors never pass a Drive id to your site: they pass the short name of a library folder, and every file they ask for must sit inside that folder or one of its sub-folders. A file elsewhere in your Drive answers “not found”, even if someone knows its id.

Show a folder on a page

Add the Drive Embed block in the block editor, choose a folder from your library and a view in the block settings. In classic content or page builders, use the shortcode [gewde_drive folder="project-files"]. The options are the same:

Option Values Used for
folder short name from the library every view
view browser (default), gallery, embed, download, upload, search what is shown
file a Drive address or id embed and download
sort, order name, modified, size; asc, desc browser
columns 1 to 8 (default 4) gallery
height 200 to 2000 pixels (default 640) embed
viewer site (default) or google embed

The browser shows the folder’s sub-folders first, then the files with their modified date and size, and a download link when downloads are on. Click a folder to open it; the breadcrumbs lead back. Click a column heading to sort, again to reverse. Navigation happens without reloading the page and moves the keyboard focus to the new place; without JavaScript, the same links still work as normal page links. The search box looks for names in the folder and its sub-folders (up to 50 folders and 100 results per search) and lists where each file is. For a page with only a search box, use [gewde_drive folder="project-files" view="search"].

A Google Drive folder on a WordPress page: breadcrumbs Client Library, Project Briefs, 2026, a search box and a table of files with name, modified date, size and download links
The file browser: breadcrumbs, sorting, search and downloads.

Previews of single files

[gewde_drive folder="project-files" view="embed" file="https://drive.google.com/file/d/…/view"] shows one file. Google Docs, Sheets, Slides and Drawings are exported as PDF and shown in the browser’s PDF viewer; PDF files the same way; videos and audio with the browser’s player (with seeking, because the plugin passes byte ranges on to Drive); images as a picture whose alternative text is the file’s Drive description, or its name. Other files show their name with a download link. In the file browser, the same previews open in a dialog when a visitor clicks a file name.

A Google Doc design brief shown as a PDF preview on a WordPress page, with the file name and a download link below it
A Google Doc previewed through your site, with a download link.

The preview is streamed by your server, so the Drive file can stay private. If you prefer Google’s own viewer for a file, share that file with a link (see Link sharing) and add viewer="google"; for files that are not shared, the plugin falls back to the site viewer.

Galleries

[gewde_drive folder="photos" view="gallery" columns="3"] shows the images of the folder as a grid of thumbnails. A click or Enter opens the lightbox: the arrow keys go to the previous and next image, Home and End to the first and last, Escape closes it and puts the focus back on the thumbnail. The image description from Drive is used as the alternative text and the caption, so add descriptions in Drive for the best result.

A gallery of six architecture images from a Google Drive folder in three columns on a WordPress page
A gallery straight from a Drive folder.

[gewde_drive folder="project-files" view="download" file="…"] shows a button with the file name and size. Google Docs, Sheets and Slides download as PDF. Downloads go through your site with the file’s own name; the limit for one file is set on the Cache tab (100 MB by default).

Upload box

[gewde_drive folder="client-uploads" view="upload"] shows the upload box of a library folder that has uploads switched on. It lists the allowed number of files, the largest size and the file types. Uploaded files go to the folder’s upload folder in Drive with the description “Uploaded on your site name by the user name”. The upload box does not scan files for viruses; open files from unknown senders with care.

The upload box on a WordPress page: choose files, the allowed number, size and file types, an Upload button and the message 2 files uploaded
The upload box sends files into a Drive folder.

Uploads and limits

The Uploads tab sets the rules for every upload box:

  • Largest file (10 MB by default, never more than your server accepts) and files per upload (5).
  • Allowed file types: file extensions. The plugin also checks that each file’s content matches its type, so a web page renamed to .pdf is refused. Types a browser could run, such as HTML, SVG, PHP or JavaScript, are never accepted.
  • Limits per connection: upload attempts per hour (20), files per day (20), and files per day from all visitors who are not logged in together (100; 0 means visitors who are not logged in cannot upload). The plugin counts per connection with a keyed hash of the IP address and does not store the address itself. Over a limit, the box answers “Too many uploads from your connection. Please try again later.” The daily limit holds even when many uploads arrive at the same moment.

By default only logged-in users can upload. If you choose Everyone for a folder, the form warns you first; keep the limits low for such folders. Staff with the Drive Embed capability are not limited.

Your site does not need link sharing: previews and downloads are streamed through your site and the Drive files stay private. Turn it on only for files you want to show with Google’s own viewer or send to people outside your site. Open Drive Embed → Folders → Files & sharing of a folder: every file shows Private or Anyone with the link, its embed shortcode and a button to share or stop sharing. Before it shares a file, the plugin asks you to confirm that anyone who has the link will be able to open the file on Google Drive, also people who never visit your site. The plugin creates link permissions that do not make the file appear in Google searches.

With View only the plugin cannot change sharing; with View and uploads it can change it for the files it uploaded; with Full access for every file.

Cache

Folder listings and file details are kept for 10 minutes by default (Cache tab, 0 to 1440 minutes; 0 asks Drive on every view). New files you add in Drive appear when the cache runs out, or at once after Clear cache. Saving a library folder, uploading and changing sharing clear the affected entries by themselves.

Privacy and security

  • The access token and the refresh token are stored encrypted in your database (not autoloaded), renewed by your server when they run out, and never sent to a browser. The client secret is stored encrypted and shown masked.
  • Every call to Google comes from your server, over https, to Google’s API addresses only (oauth2.googleapis.com, www.googleapis.com, and googleusercontent.com for thumbnails), with WordPress’s safe HTTP functions and SSL verification switched on.
  • Files are shown inline only for safe types (images, PDF, audio, video); everything else is sent as a download, with headers that stop browsers from guessing types.
  • The plugin loads no outside scripts, fonts or styles. Pages load Google’s own viewer only where you choose viewer="google".
  • Every REST route has a permission check; uploads also need a fresh form token.

Without an active license

Without an active license, nothing from Google Drive is shown on your site, the plugin’s addresses answer “no access”, and the settings are read-only. Staff see a short note where a block is. Disconnect keeps working, so you can always remove the Google access.

Disconnect and uninstall

Disconnect on the Connection tab asks Google to revoke the plugin’s access and deletes the stored tokens; pages stop showing Drive content until you connect again. You can also remove the access in your Google Account under Security → Your connections to third-party apps and services. When you delete the plugin, it asks Google to revoke the access, always removes the tokens, the cache and its upload log, and removes the folder library and the settings unless you tick Keep the folder library and settings on the Cache tab. Nothing in your Google Drive is deleted.

How GravityExtra Drive Embed differs

  • Your own Google client. You create the OAuth client in your own Google Cloud project; no outside service sits between your site and Google, and you can see and remove the access in your Google account.
  • Private files by default. Previews and downloads are streamed through your site after the access check, so you do not have to share Drive files with “anyone with the link” to show them.
  • Access by role, per folder. The library decides who sees which folder; files outside the chosen folder are never served, also when someone guesses an id.
  • Narrow permissions. View only needs read access; uploads add a scope limited to the plugin’s own files; full access only when you need it.
  • Uploads with real limits. Type and content checks plus hourly and daily limits per connection, so a public upload box cannot fill your Drive.
  • Light pages. One small stylesheet and one small script without jQuery, only on pages that use the block.

Troubleshooting

  • Google says redirect_uri_mismatch. The redirect URI in the OAuth client must be exactly the one shown on the Connection tab, including https and the part after the question mark. Copy it again with the Copy button.
  • Google says access_denied or the app is blocked. With an External app in Testing, add your account as a test user. With Internal, sign in with an account of your Workspace organisation.
  • The connection stops working after a week. The app is still in the Testing state; publish it (step 3) and connect again.
  • A new file does not show up. Clear the cache on the Cache tab, or wait until the cache time runs out.
  • “This file is not inside the chosen folder.” The file id in the block belongs to another folder; add that folder to the library or move the file.
  • Uploads fail with “Google Drive did not accept it”. With View and uploads, the upload folder must have been created by the plugin; use Create an upload folder.
  • A large file does not open. Raise the limit for files through the site on the Cache tab, or offer a download link from Drive with link sharing.

Google Drive, Google Docs, Google Sheets and Google Slides are trademarks of Google LLC. GravityExtra Drive Embed is not made or endorsed by Google.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr