How to Use Google Drive in WordPress Media Library
You can use your Google Drive photos and files inside the WordPress media library.
Do you Use Google Drive?
I’m sure that many – if not most – of you also use Google Drive to store your files and documents? Then this guide is for you!
I personally use Google Drive for almost all my files. My photos, documents, spreadsheets and everything else go in there. I also run multiple WordPress websites, therefore it is convenient for me to be able to import by Google Drive media into the WordPress media library as I create posts and pages. It saves me time and effort.
Import Google Drive files into the WordPress media library with ease!
There are several ways to do this from what I can see and there are various WordPress plugins for Google Drive but I’ll show you my way using a specific plugin which I’ve tested and used over and over again.
Using Google Drive with WordPress
Follow these instructions to use Google Drive in WordPress media library:
1. Install the External Media plugin
First and foremost, you need to login to your WordPress dashboard and go to Plugins > Add New to install a new plugin.
Search for “external media” plugin and install the External Media plugin by Minnur Yunusov.
Once you’ve clicked the Install Now button, wait for it to install then click the blue Activate button to activate it.
2. Get Google Developers API OAuth Client ID
Go to the Google Developers console to get an OAuth client ID.
To do this, go to Credentials in the sidebar and click on Create Credentials and choose OAuth Client ID. Go ahead and follow the Configure Consent Screen button, fill in all the values correctly and when you’re done, click the Save button.
On the next screen, choose Web Application and fill in your hostname/domain name and for the redirect URL, get that under Settings > External Media in your WordPress dashboard at the very bottom. So paste that then click the Create button.
Then copy the newly created client ID to your clipboard which will be used in step 3 below.
3. Configure External Media plugin Google Drive
With the plugin installed and activated, go to Settings > External Media in the WordPress dashboard.
Then tick/check the Enable this plugin checkbox at the top to start using Google Drive with WordPress.
Scroll down a bit and paste the Client ID you copied in step 2 above from Google developers console. For the Application ID field – as it says there – just use the first few numbers in the Client ID and that’s all.
Go ahead and configure the rest of the settings as needed and click Save Changes at the bottom to complete.
I suggest that you untick/uncheck the Filter checkbox since that will cause Google Drive to only show starred items/documents.
4. Import Google Drive Files into WordPress
To start importing, go to Posts > Add New to create a new post or go and edit an existing post, page or custom post.
On the post editing screen, click on the Add Media button just above the editor and select the Upload Files tab at the top. You will now see a button that says Import From Google Drive. Click on that to authenticate and start using the Google Drive files in your WordPress media library.
You can select a single or multiple Google Drive files as needed.